GNOME Bugzilla – Bug 748064
gnulib vfprintf returns desired (not actual) number of bytes, ignores errors
Last modified: 2016-01-14 15:13:30 UTC
To be honest, i don't remember what problems were caused by it returning the number of bytes it *wanted* to write instead of the number of bytes it actually wrote. Probably related to the fact that fwrite could independently fail, and ignoring its return value ignores that error.
Created attachment 301855 [details] [review] Make gnulib vfprintf return the number of bytes actually written
Hi LRN, Sorry, I have to say that I am no expert on the part where we need to re-do parts of the CRT for full portability capabilities, so I'm not able to say anything that would be helpful for this. I think someone knowledgeable with this would be the best bet to look at your patch though, especially as other platforms may well be using this. Another real part (on my side, MSVC-side that is), though, is bug 712225, as GLib would want the underlying strtod() that it uses to conform to the C99 specs, which the standard msvcrt.dll/msvcrxx.dll's do not provide, though I heard this situation may change for the better with msvcr130.dll (MSVC 2015+ CRT). With blessings!
Review of attachment 301855 [details] [review]: As pointed out on IRC the patch looks good to me.
Attachment 301855 [details] pushed as b7774b1 - Make gnulib vfprintf return the number of bytes actually written