diff options
author | Rich Felker <dalias@aerifal.cx> | 2016-02-16 13:26:16 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2016-02-16 13:26:16 -0500 |
commit | 10a17dfbad2c267d885817abc9c7589fc7ff630b (patch) | |
tree | 18813bb6680ec2140a595e2b7364d61626a5a1d2 /src/dirent/scandir.c | |
parent | 9c102700a7b9e743da692d3cb6bfa580fcdd4379 (diff) | |
download | musl-10a17dfbad2c267d885817abc9c7589fc7ff630b.tar.gz musl-10a17dfbad2c267d885817abc9c7589fc7ff630b.tar.xz musl-10a17dfbad2c267d885817abc9c7589fc7ff630b.zip |
fix assumption in fputs that fwrite returning 0 implies an error
internally, the idiom of passing nmemb=1 to fwrite and interpreting the return value of fwrite (which is necessarily 0 or 1) as failure/success is fairly widely used. this is not correct, however, when the size argument is unknown and may be zero, since C requires fwrite to return 0 in that special case. previously fwrite always returned nmemb on success, but this was changed for conformance with ISO C by commit 500c6886c654fd45e4926990fee2c61d816be197.
Diffstat (limited to 'src/dirent/scandir.c')
0 files changed, 0 insertions, 0 deletions