From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 111c93,c1db52110ef2b04a X-Google-Attributes: gid111c93,public X-Google-Thread: 1103af,c1db52110ef2b04a X-Google-Attributes: gid1103af,public From: Andreas Kahari Subject: Re: sprintf bug? Date: 2000/05/26 Message-ID: <8gmilh$kcj$1@nnrp1.deja.com>#1/1 X-Deja-AN: 627689878 References: <8gmhrd$jqj$1@nnrp1.deja.com> X-Http-Proxy: 1.0 bazaar:3128 (Squid/2.3.STABLE1), 1.0 x56.deja.com:80 (Squid/1.1.22) for client 130.238.17.136, 130.238.17.136 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Fri May 26 19:18:25 2000 GMT X-MyDeja-Info: XMYDJUIDandkaha Newsgroups: comp.os.linux.alpha,comp.os.linux.misc X-Http-User-Agent: Mozilla/4.73 [en] (X11; I; SunOS 5.7 sun4u; Nav) In article <8gmhrd$jqj$1@nnrp1.deja.com>, U.V. Ravindra wrote: > > > 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 > > I don't have access to a Linux box right now and I can't reproduce your result on my Solaris box. It seems to me that you're only using 'sprintf' to copy a string into an array of characters. Why don't you use 'strcpy', 'memcpy', or a simple loop instead? But I agree, it looks strange... The 'i' should have been '\0' (or "\0"). /A -- # Andreas K�h�ri, . # All junk e-mail is reported to the # appropriate authorities, no exceptions. Sent via Deja.com http://www.deja.com/ Before you buy.