[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] fixes for apr_vformatter and apr_snprintf

From: Jim Jagielski <jim_at_jaguNET.com>
Date: 2002-07-10 23:58:35 CEST

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_at_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
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jul 11 00:05:02 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.