diff --git a/src/apcupsd.c b/src/apcupsd.c index c7a40c9c..95065e29 100644 --- a/src/apcupsd.c +++ b/src/apcupsd.c @@ -104,7 +104,7 @@ static int get_line(int sock, char line[], short linesize) { while (sz > linesize) { // this is just a hack (being lazy), this should not happen anyway net_recv(sock, line, linesize); - sz -= sizeof(line); + sz -= linesize; } if (!net_recv(sock, line, sz)) return 0; line[sz] = 0;