bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: check for C99-compliant snprintf


From: Ben Pfaff
Subject: Re: check for C99-compliant snprintf
Date: Mon, 19 Feb 2007 20:57:02 -0800
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Ben Pfaff wrote on Friday/Saturday:
>> The following patch attempts to remedy the situation.
>
> I cannot see the big picture in this change. You want a snprintf() whose
> return value is correct but which still doesn't support argument reordering
> on NetBSD and doesn't support %n on HP-UX? And an unchanged printf() and
> fprintf()? 

I want a [v]snprintf that always null-terminates its output
string (if the size argument is greater than zero), so that I can
safely call [v]snprintf, then treat the result as a
null-terminated string without having to check the return value
at all.  The pre-C99 [v]snprintfs don't necessarily do this, and
in particular Microsoft documents its _[v]snprintf to *not*
null-terminate if the output is too long.

> Please see the other mail ("Printf for gnulib") for a proposal
> how to get it all right.

Since there's momentum to fix all these problems at the same
time, I'll withdraw my proposal for a module, and work around the
problem for now.
-- 
Ben Pfaff 
address@hidden
http://benpfaff.org





reply via email to

[Prev in Thread] Current Thread [Next in Thread]