Re: [PATCH v4] Add utf8_fprintf helper which returns correct columns
- From
Torsten Bögershausen <tboegi@web.de>
- Date
- Feb 8, 2013, 06:13 UTC
- Message-ID
- <51149770.5070303@web.de>
- In-Reply-To
- <51149542.8060307@web.de>
(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.