X-Git-Url: http://git.dolda2000.com/gitweb/?a=blobdiff_plain;f=clients%2Fgtk2%2Fhublist-old.c;h=ed4555e6b76991b95127f98595842323d96308c7;hb=302a260054ea38d3cb97be6d1a3010082c09265d;hp=83da7fcf2a8d3629cf7fb51fa941dffd648f83a9;hpb=d05758f6eda21695e6215d60d28b9747d0b8aaa3;p=doldaconnect.git diff --git a/clients/gtk2/hublist-old.c b/clients/gtk2/hublist-old.c index 83da7fc..ed4555e 100644 --- a/clients/gtk2/hublist-old.c +++ b/clients/gtk2/hublist-old.c @@ -1,6 +1,6 @@ /* * Dolda Connect - Modular multiuser Direct Connect-style client - * Copyright (C) 2007 Fredrik Tolf (fredrik@dolda2000.com) + * Copyright (C) 2007 Fredrik Tolf * * 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 @@ -45,10 +45,10 @@ int pubhuboldhandler(int op, char *buf, size_t len) 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; @@ -73,7 +73,7 @@ int pubhuboldhandler(int op, char *buf, size_t len) free(fields[i]); } } - return(p - buf); + return(p2 - buf); break; case PHO_EOF: cols[0] = 3; names[0] = _("# users");