This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Bug report for fputs()
- From: Olivier Langlois <Olivier dot Langlois at streamtheworld dot com>
- To: "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Wed, 15 Aug 2007 09:59:57 -0400
- Subject: Bug report for fputs()
- Accept-language: en-US
- Acceptlanguage: en-US
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