After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748064 - gnulib vfprintf returns desired (not actual) number of bytes, ignores errors
gnulib vfprintf returns desired (not actual) number of bytes, ignores errors
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-04-17 16:08 UTC by LRN
Modified: 2016-01-14 15:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make gnulib vfprintf return the number of bytes actually written (1.41 KB, patch)
2015-04-17 16:08 UTC, LRN
committed Details | Review

Description LRN 2015-04-17 16:08: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.
Comment 1 LRN 2015-04-17 16:08:35 UTC
Created attachment 301855 [details] [review]
Make gnulib vfprintf return the number of bytes actually written
Comment 2 Fan, Chun-wei 2015-04-29 01:45:50 UTC
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!
Comment 3 Ignacio Casal Quinteiro (nacho) 2016-01-14 15:06:02 UTC
Review of attachment 301855 [details] [review]:

As pointed out on IRC the patch looks good to me.
Comment 4 LRN 2016-01-14 15:13:26 UTC
Attachment 301855 [details] pushed as b7774b1 - Make gnulib vfprintf return the number of bytes actually written