[Top][All Lists]

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

Re: sprintf usage

From: Cameron Laird
Subject: Re: sprintf usage
Date: Thu, 4 May 2006 19:54:56 +0000
User-agent: Mutt/1.5.11+cvs20060126

On Thu, May 04, 2006 at 08:22:27PM +0200, Pawel Kot wrote:
> There seems to be a problem with gnokii sources and some compilers. I
> got the report from FC4 and gcc version 4.0.2 20051125. The problem is
> with interpretation of:
>  sprintf(buffer, "%s%d", buffer, digit);
> It used to work so far but under FC4 it behaves always in the was as
> buffer was empty (regardles of buffer contents) and the result string
> is always the digit.
> Is it a bug in gcc or is it misuse of sprintf?
The issue is with the run-time library rather than gcc
in a narrow sense.

I haven't found any documentation I consider definitive
on the question.  I'd sure avoid that coding, though; 
even if there's a standard that claims to require the
result you're after, it looks too fragile to me.  Use
a scratch buffer.

reply via email to

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