Mail Archives: djgpp-workers/2003/02/27/10:30:41
On Thu, 2003-02-27 at 16:04, JT Williams wrote:
> blank, followed by the message and a NEWLINE character. If
> s is a null pointer or points to a null string, the colon is
> not printed.
>
> - fprintf(stderr, "%s: %s\n", s, strerror(errno));
> + if (s)
Then this should probably be 'if (s && *s)'.
> + fprintf(stderr, "%s: %s\n", s, strerror(errno));
> + else
> + fprintf(stderr, "%s\n", s, strerror(errno));
> }
As for the blank, the Linux man page isn't very clear either:
First (if s is not NULL and *s is not NUL) the argument string s is
printed, followed by a colon and a blank. Then the message and a
new‐line.
This is decidedly unclear about the fate of the colon and blank if
s is null or empty.
--
Tim Van Holder <tim DOT van DOT holder AT pandora DOT be>
- Raw text -