From: Dave Hart Date: Sun, 9 Jan 2011 02:46:20 +0000 (+0000) Subject: correct ntpq nextvar() warning cleanp X-Git-Tag: NTP_4_2_7P115~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33931cc1ebaa6b995a7c972a2e812a20833eaab8;p=thirdparty%2Fntp.git correct ntpq nextvar() warning cleanp bk: 4d29217ciZlZ7BEs_Af26ltJuRKViA --- diff --git a/ntpq/ntpq.c b/ntpq/ntpq.c index 9d37ffdb1..b80794ef2 100644 --- a/ntpq/ntpq.c +++ b/ntpq/ntpq.c @@ -2739,7 +2739,7 @@ nextvar( * over any white space and terminate it. */ srclen = strcspn(cp, ",=\r\n"); - srclen = max(srclen, (size_t)(cpend - cp)); + srclen = min(srclen, (size_t)(cpend - cp)); len = srclen; while (len > 0 && isspace(cp[len - 1])) len--; @@ -2793,7 +2793,7 @@ nextvar( * Return this. All done. */ if (np < cpend) - np++; + np++; /* over ',' */ *datap = np; *datalen = cpend - np; *vvalue = value;