From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1103af,c1db52110ef2b04a,start X-Google-Attributes: gid1103af,public X-Google-Thread: 111c93,c1db52110ef2b04a,start X-Google-Attributes: gid111c93,public From: U.V. Ravindra Subject: sprintf bug? Date: 2000/05/26 Message-ID: <8gmhrd$jqj$1@nnrp1.deja.com>#1/1 X-Deja-AN: 627686309 X-Http-Proxy: 1.0 x52.deja.com:80 (Squid/1.1.22) for client 192.147.112.2 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Fri May 26 19:04:24 2000 GMT X-MyDeja-Info: XMYDJUIDu_v_ravindra Newsgroups: comp.os.linux.alpha,comp.os.linux.misc X-Http-User-Agent: Mozilla/4.73 [en] (X11; U; SunOS 5.7 sun4u) 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.