From: Florian Forster Date: Mon, 8 Jun 2015 10:34:41 +0000 (+0200) Subject: apcups plugin: Handle "END APC" lines correctly and stop reading. X-Git-Tag: collectd-5.6.0~698 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fb075e15e3400afdb691b88f1e1a4a38578aaba9;p=collectd.git apcups plugin: Handle "END APC" lines correctly and stop reading. Fixes: #617 --- diff --git a/src/apcups.c b/src/apcups.c index 77386534..66fe45e1 100644 --- a/src/apcups.c +++ b/src/apcups.c @@ -325,6 +325,9 @@ static int apc_query_server (char const *node, char const *service, printf ("net_recv = `%s';\n", recvline); #endif /* if APCMAIN */ + if (strncmp ("END APC", recvline, strlen ("END APC")) == 0) + break; + toksaveptr = NULL; tokptr = strtok_r (recvline, " :\t", &toksaveptr); while (tokptr != NULL)