Mail Archives: djgpp-workers/2003/02/27/12:04:05.1
JT Williams wrote:
>
> Second version of perror.c patch:
>
> --- perror.orig 1994-12-10 21:52:02.000000000 -0600
> +++ perror.c 2003-02-27 09:52:48.223807000 -0600
> @@ -6,5 +6,7 @@
> void
> perror(const char *s)
> {
> - fprintf(stderr, "%s: %s\n", s, strerror(errno));
> + if ((s && *s) || (strcmp(s, "") == 0))
> + fprintf(stderr, "%s: ", s);
> + fprintf(stderr, "%s\n", strerror(errno));
> }
That executes strcmp(NULL, ""). *s took care of it.
--
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT worldnet DOT att DOT net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
- Raw text -