about summary refs log tree commit diff
path: root/src/prng
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2023-06-12 19:56:08 -0400
committerRich Felker <dalias@aerifal.cx>2023-06-12 19:56:08 -0400
commit3a23cd06b08054f81bf904c414e0d083a56248f2 (patch)
tree14d8102a036b0283d51718ef2bf7f58bdfa36873 /src/prng
parentfa4a8abd06a401822cc8ba4e352a219544c0118d (diff)
downloadmusl-3a23cd06b08054f81bf904c414e0d083a56248f2.tar.gz
musl-3a23cd06b08054f81bf904c414e0d083a56248f2.tar.xz
musl-3a23cd06b08054f81bf904c414e0d083a56248f2.zip
all printf variants: fix argument type handling for %c and %lc
%c takes an argument of type int, not char, and %lc/%C takes an
argument of type wint_t (unsigned), not int.

for most cases, this makes no practical difference, but since wide
printf variants convert narrow %c format specifiers via btowc,
interpreting the promoted-to-int unsigned char value passed in as a
(signed, on most archs) char causes 255 to get collapsed to EOF and
interpreted as such by btowc.

this is only relevant in the byte-based C locale, so prior to commit
f22a9edaf8a6f2ca1d314d18b3785558279a5c03, there was no observable
distinction in behavior. for UTF-8, all bytes which might be negative
when interpreted as char are encoding errors when used with %c/btowc.
Diffstat (limited to 'src/prng')
0 files changed, 0 insertions, 0 deletions