Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* sprintf bug?
@ 2000-05-26  4:00 U.V. Ravindra
  2000-05-26  4:00 ` Andreas Kahari
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: U.V. Ravindra @ 2000-05-26  4:00 UTC (permalink / raw)




I'm using SuSE 6.3 (Kernel 2.2.13 glibc 2.1.2) on an Alpha EV67.
Here's what I'm trying  to do

	char buffr[4096+1]

	...
	...
	printf("before %s\n", buffr);
	sprintf(buffr, "0, 0, 0, ");
	printf("after %s\n", buffr);

And I see the output:

before dwki_nr_ibind(100, fname_var, 0,
after  0, 0, 0,i

This is clearly wrong - the 'i' at the end of the 'after'
output is extraneous.  I find that the call to sprintf
puts junk characters at the end of the string.  The problem
is random (in the sense that not all calls to sprintf
put junk characters in buffr), but consistent (in the sense
that it is the SAME sprintf call/s that exhibit this
erroneous behavior).

Anyone aware of a problem with glibc 2.1.2's sprintf?

Advance thanks for all answers.

UVR.



Sent via Deja.com http://www.deja.com/
Before you buy.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2000-05-28  4:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-05-26  4:00 sprintf bug? U.V. Ravindra
2000-05-26  4:00 ` Andreas Kahari
2000-05-26  4:00   ` U.V. Ravindra
2000-05-27  4:00     ` Tony Hammitt
2000-05-27  4:00 ` Harlan Grove
2000-05-27  4:00   ` sandrews
2000-05-28  4:00     ` Tony Hammitt
2000-05-27  4:00 ` Juergen Heinzl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox