Use explicit braces to avoid ambiguous else.

This commit is contained in:
Xin LI 2006-12-09 15:23:20 +00:00
parent f2588359cb
commit 82417e9f03

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)