delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/02/27/10:30:41

Subject: Re: perror
From: Tim Van Holder <tim DOT van DOT holder AT pandora DOT be>
To: djgpp-workers AT delorie DOT com
Cc: JT Williams <jeffw AT darwin DOT sfbr DOT org>
In-Reply-To: <20030227150458.GA3476@kendall.sfbr.org>
References: <20030227150458 DOT GA3476 AT kendall DOT sfbr DOT org>
Organization:
Message-Id: <1046360051.30750.3.camel@leeloo>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.2.2
Date: 27 Feb 2003 16:34:11 +0100
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019