This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Bug report for fputs()


I am not sure if the return value is defined by the ANSI C standard or if it is an implementation specific feature but all documentation about fputs() return value that I have seen say:

puts() and fputs() return a non-negative number on success, or EOF on error.

Newlib implementation of fputs() returns 0 on success. I have double checked this by looking in the source code and the header comment of function __sfvwrite_r which is used by fputs() seems to confirm this:

/*
 * Write some memory regions.  Return zero on success, EOF on error.
 *
 * This routine is large and unsightly, but most of the ugliness due
 * to the three different kinds of output buffering is handled here.
 */

Greetings,
Olivier Langlois
http://www.olivierlanglois.net


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]