apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: [PATCH] fixes for apr_vformatter and apr_snprintf
Date Wed, 10 Jul 2002 21:58:35 GMT
Nuutti Kotivuori wrote:
> 
> * apr_snprintf behaved incorrectly when the output was truncated. It
> returned the length that was passed in, but that is including the
> null-terminator.
> 

>From the man page for snprintf():
  if the return value is greater than or
  equal to the size argument, the string was too short and some of the
  printed characters were discarded.

So if truncated, what is returned *must* be >= the length passed in.
-- 
===========================================================================
   Jim Jagielski   [|]   jim@jaguNET.com   [|]   http://www.jaguNET.com/
      "A society that will trade a little liberty for a little order
             will lose both and deserve neither" - T.Jefferson

Mime
View raw message