Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Aug 2001 14:37:10 +0100
From:      Brian Somers <brian@Awfulhak.org>
To:        Maxim Sobolev <sobomax@FreeBSD.ORG>
Cc:        brian@FreeBSD.ORG (Brian Somers), kris@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, brian@freebsd-services.com
Subject:   Re: cvs commit: src/sbin/newfs mkfs.c src/sbin/ping6 ping6.c 
Message-ID:  <200108201337.f7KDbAU83638@hak.lan.Awfulhak.org>
In-Reply-To: Message from Maxim Sobolev <sobomax@FreeBSD.ORG>  of "Mon, 20 Aug 2001 16:10:37 %2B0300." <200108201311.f7KDBvH15963@vega.vega.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> > 
> > brian       2001/08/20 05:56:45 PDT
> > 
> >   Modified files:
> >     sbin/newfs           mkfs.c 
> >     sbin/ping6           ping6.c 
> >     sbin/route           route.c 
> >   Log:
> >   Handle snprintf() returning -1.
> 
> What is condition for snprintf() returning -1? The manpage doesn't provide
> any clue, so as the SUSv2 specification. Perhaps manpage should be extended
> to be more clear in this area.

From what I can tell, it can return -1 when it's given an invalid 
format string.  It could probably do likewise for other reasons too 
(he says vaguely), depending on if vfprintf() decides to return EOF 
(this probably can't happen the way snprintf() sets the FILE up).

I don't believe that any of the cases I've patched could actually 
happen at the moment using our libc, but it's possible that other 
snprintf() implementations may fail, so we should deal with that for 
portability's sake.

> -Maxim

-- 
Brian <brian@freebsd-services.com>                <brian@Awfulhak.org>
      http://www.freebsd-services.com/        <brian@[uk.]FreeBSD.org>
Don't _EVER_ lose your sense of humour !      <brian@[uk.]OpenBSD.org>



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200108201337.f7KDbAU83638>