Use explicit braces to avoid ambiguous else.

This commit is contained in:
delphij 2006-12-09 15:23:20 +00:00
parent f458d34cdf
commit ae1fcdf22f

View File

@ -393,11 +393,12 @@ getformat(void)
if (boring) /* no need to bother */
return;
for (p = format; *p; p++) /* look for '%' */
if (*p == '%')
if (*p == '%') {
if (p[1] == '%')
p++; /* leave %% alone */
else
break;
}
sz = sizeof(format) - strlen(format) - 1;
if (!*p && !chardata) {
if (snprintf(p, sz, "%%.%df", prec) >= (int)sz)