Subject: Re: [PATCH v4] Add utf8_fprintf helper which returns correct columns

From: Torsten Bögershausen <[email-masked]>
Date: Fri, 08 Feb 2013 07:13:04 +0100

(Sorry for confusing: I should have written:)

Please see below for specifications on fputs()

Linux:
RETURN VALUE
fputc(), putc() and putchar() return the character written as an unsigned char cast to an int or EOF on error.
puts() and fputs() return a nonnegative number on success, or EOF on error.

Mac OS:
COMPATIBILITY
fputs() now returns a non-negative number (as opposed to 0) on successful completion. As a result, many tests (e.g., "fputs() == 0", "fputs() != 0") do not give the desired result.
Use "fputs() != EOF" or "fputs() == EOF" to determine success or failure.

Posix:
RETURN VALUE
Upon successful completion, fputs() shall return a non-negative number. Otherwise, it shall return EOF, set an error indicator for the stream, and set errno to indicate the error.