/*
* Dolda Connect - Modular multiuser Direct Connect-style client
- * Copyright (C) 2007 Fredrik Tolf (fredrik@dolda2000.com)
+ * Copyright (C) 2007 Fredrik Tolf <fredrik@dolda2000.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
break;
case PHO_DATA:
p = buf;
- while((p = memchr(p, '\n', len)) != NULL)
+ while((p = memchr((p2 = p), '\n', len - (p - buf))) != NULL)
{
*(p++) = 0;
- for(i = 0, p2 = buf; i < 4; i++) {
+ for(i = 0; i < 4; i++) {
fields[i] = p2;
if((p2 = strchr(p2, '|')) == NULL)
break;
free(fields[i]);
}
}
- return(p - buf);
+ return(p2 - buf);
break;
case PHO_EOF:
cols[0] = 3; names[0] = _("# users");