apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: cvs commit: apr/strings apr_strings.c
Date Wed, 30 Jun 2004 11:52:00 GMT
> > 
> > apr_snprintf(buf, 5, "%3d ", (int) size);
> > if (buf[3] != ' ') { /* catch overflow */
> >      return strcpy(buf, "****");
> > }
> > 
> 
> If I understand the problem correctly, doesn't snprintf() return
> the number of bytes that would have been printed if there had been
> no limit. Thus, can't we check that the return value is <=
> the actual buffer size?
> 

And apr_snprintf() tells us the same if len is 0.

Mime
View raw message