From: Tim Rühsen Date: Sun, 28 Oct 2018 10:33:27 +0000 (+0100) Subject: mprintf: avoid unsigned integer overflow warning X-Git-Tag: curl-7_63_0~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4f2a5bc1b6146f96a8a5778a13ab3d0c6071040;p=curl mprintf: avoid unsigned integer overflow warning The overflow has no real world impact. Just avoid it for "best practice". Code change suggested by "The Infinnovation Team" and Daniel Stenberg. Closes #3184 --- diff --git a/lib/mprintf.c b/lib/mprintf.c index d2d91d743..e19093678 100644 --- a/lib/mprintf.c +++ b/lib/mprintf.c @@ -835,7 +835,7 @@ static int dprintf_formatf( while(width-- > 0) OUTCHAR(' '); - while((len-- > 0) && *str) + for(; len && *str; len--) OUTCHAR(*str++); if(p->flags&FLAGS_LEFT) while(width-- > 0)