Yo Achim! On Mon, 04 Feb 2019 21:37:35 +0100 Achim Gratz via devel <devel@ntpsec.org> wrote:
> This defect bisects to the unlikely commit: here is the entire change: @@ -1198,21 +1198,14 @@ ctl_putdblf( double d ) { - char *cp; - const char *cq; - char buffer[200]; + char buffer[200]; + char buf[50]; - cp = buffer; - cq = tag; - while (*cq != '\0' && cp < buffer + sizeof(buffer) - 1) - *cp++ = *cq++; - *cp++ = '='; - INSIST((size_t)(cp - buffer) < sizeof(buffer)); - snprintf(cp, sizeof(buffer) - (size_t)(cp - buffer), - use_f ? "%.*f" : "%.*g", - precision, d); - cp += strlen(cp); - ctl_putdata(buffer, (unsigned)(cp - buffer), false); The end result is: char buffer[200]; char buf[50]; strlcpy(buffer, tag, sizeof(buffer)); snprintf(buf, sizeof(buf), use_f ? "=%.*f" : "%.*g", precision, d); strlcat(buffer, buf, sizeof(buffer)); ctl_putdata(buffer, strlen(buffer), false); Am I missing something very obvious? RGDS GARY --------------------------------------------------------------------------- Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703 g...@rellim.com Tel:+1 541 382 8588 Veritas liberabit vos. -- Quid est veritas? "If you can’t measure it, you can’t improve it." - Lord Kelvin
pgpjXZHh8vTGu.pgp
Description: OpenPGP digital signature
_______________________________________________ devel mailing list devel@ntpsec.org http://lists.ntpsec.org/mailman/listinfo/devel