According to the manual: “The puts() function returns a non-zero value
if an error occurs; otherwise it returns a zero. When an error has
occurred, errno contains a value that indicates the type of error that
has been detected.”
If I have:
if (puts(“Some text.”) != 0){
perror(“Oops:”);
}
I always get:
Some text.
Oops: No error
Am I doing something wrong or is the documentation wrong? If the later,
what are the correct return values?