X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Paul Wilkins User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: assembly code of the "strange error" - program References: <20040727070949 DOT 29244 DOT 00000306 AT mb-m19 DOT aol DOT com> <200407271306 DOT i6RD6e8o010681 AT envy DOT delorie DOT com> <200407271836 DOT i6RIa5vk015726 AT envy DOT delorie DOT com> <86pk6woegwe DOT fsf AT sirppi DOT helsinki DOT fi> In-Reply-To: <86pk6woegwe.fsf@sirppi.helsinki.fi> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 26 Message-ID: Date: Wed, 28 Jul 2004 19:28:27 +1200 NNTP-Posting-Host: 218.101.50.29 X-Complaints-To: abuse AT tsnz DOT net X-Trace: news02.tsnz.net 1090999842 218.101.50.29 (Wed, 28 Jul 2004 19:30:42 NZST) NNTP-Posting-Date: Wed, 28 Jul 2004 19:30:42 NZST Organization: TelstraClear To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Esa A E Peuha wrote: > Paul Wilkins writes: > > >>As I'm expecting memset to accept ints in the middle value there should >>be no difference. > > > It _does_ accept ints as the value. However, it only uses the least > significant byte of that value. > > >>I could've sworn that memset used INT, not BYTE, for the middle element, >>so memset would fill the memory range with the integer number 4, > > > It will not. void *memset(void *s, int c, size_t n); Ahh, I get it. Even though the header specifies int, it really is a byte instead. This shows that sometimes you have to look at more than just the header. -- Paul Wilkins