[uClinux-dev] freopen problem

Friedrich, Lars lars.friedrich at wago.com
Wed Aug 3 17:45:00 EDT 2005

It's not related to the error but:

> if (fputs("Hello world", stream) < 0) {

"The fputs() function shall write the __null-terminated string__
pointed to by s to the stream pointed to by stream.[...]" - POSIX

"[...]fputs() return a non - negative number on sucess, or EOF on error."

EOF does not necessarily equal < 0 (or -1).

Best regards,
Lars Friedrich

More information about the uClinux-dev mailing list