diff options
author | Rich Felker <dalias@aerifal.cx> | 2018-01-10 20:45:02 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-01-10 20:45:02 -0500 |
commit | b64539ae06aa91a407359238f4e909adb9bfab3d (patch) | |
tree | 674464329da63ee231670c74cd07e44f42481e3b /src/stdio/fclose.c | |
parent | 32482f61da7650ff10741bd5aedd66bbc3ea165b (diff) | |
download | musl-b64539ae06aa91a407359238f4e909adb9bfab3d.tar.gz musl-b64539ae06aa91a407359238f4e909adb9bfab3d.tar.xz musl-b64539ae06aa91a407359238f4e909adb9bfab3d.zip |
fix printf alt-form octal with value 0 and no explicit precision
commit 78897b0dc00b7cd5c29af5e0b7eebf2396d8dce0 wrongly simplified Dmitry Levin's original submitted patch fixing alt-form octal with the zero flag and field width present, omitting the special case where the value is zero. as a result, printf("%#o",0) wrongly prints "00" rather than "0". the logic prior to this commit was actually better, in that it was aligned with how the alt-form flag (#) for printf is specified ("it shall increase the precision"). at the time there was no good way to avoid the zero flag issue with the old logic, but commit 167dfe9672c116b315e72e57a55c7769f180dffa added tracking of whether an explicit precision was provided. revert commit 78897b0dc00b7cd5c29af5e0b7eebf2396d8dce0 and switch to using the explicit precision indicator for suppressing the zero flag.
Diffstat (limited to 'src/stdio/fclose.c')
0 files changed, 0 insertions, 0 deletions