diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2010-11-06 13:57:08 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2010-11-06 18:09:44 -0700 |
commit | ca9aa7596094c4af094edb7eb63648570d53c100 (patch) | |
tree | db5f45604c3bbdcf1b0cb2e68fdcd804a682bc2a /tests/rmdir | |
parent | 6c058b2dabe2e577d56e8c2c82cec550ff82f085 (diff) | |
download | coreutils-ca9aa7596094c4af094edb7eb63648570d53c100.tar.xz |
stat: do not rely on undefined behavior in printf formats
* src/stat.c (digits, printf_flags): New static vars.
(make_format): New function.
(out_string, out_int, out_uint, out_uint_o, out_uint_x):
(out_minus_zero): Use it to avoid undefined behavior when invoking
printf.
(print_it): Check for invalid conversion specifications such as
%..X and %1-X, which would otherwise rely on undefined behavior
when invoking printf.
* tests/misc/stat-nanoseconds: Check that the "I" printf flag
doesn't mess up in the C locale, as it formerly did on non-GNU
hosts.
Diffstat (limited to 'tests/rmdir')
0 files changed, 0 insertions, 0 deletions