Use explicit braces to avoid ambiguous else.
This commit is contained in:
parent
f2588359cb
commit
82417e9f03
@ -393,11 +393,12 @@ getformat(void)
|
|||||||
if (boring) /* no need to bother */
|
if (boring) /* no need to bother */
|
||||||
return;
|
return;
|
||||||
for (p = format; *p; p++) /* look for '%' */
|
for (p = format; *p; p++) /* look for '%' */
|
||||||
if (*p == '%')
|
if (*p == '%') {
|
||||||
if (p[1] == '%')
|
if (p[1] == '%')
|
||||||
p++; /* leave %% alone */
|
p++; /* leave %% alone */
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
sz = sizeof(format) - strlen(format) - 1;
|
sz = sizeof(format) - strlen(format) - 1;
|
||||||
if (!*p && !chardata) {
|
if (!*p && !chardata) {
|
||||||
if (snprintf(p, sz, "%%.%df", prec) >= (int)sz)
|
if (snprintf(p, sz, "%%.%df", prec) >= (int)sz)
|
||||||
|
Loading…
Reference in New Issue
Block a user