X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: problem sending data to file Date: 2 Oct 2003 09:50:06 GMT Organization: Aachen University of Technology (RWTH) Lines: 19 Message-ID: References: NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 1065088206 17412 137.226.32.75 (2 Oct 2003 09:50:06 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 2 Oct 2003 09:50:06 GMT Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Jason Carney wrote: > long int *len; > *len = 0; These two lines contain a massive bug. len is a pointer pointing nowhere, so you're writing that zero to nowhere. That's causing undefined behaviour. > x is a pointer to a character array, why is printf there? From the given input, the only possible answer to that is "because". Maybe you should ask whoever wrote that code. Given you've already caused undefined behaviour before, odds are this is just a side effects. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.