delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/10/02/06:01:40

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
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: <blgsce$h04$1@nets3.rz.RWTH-Aachen.DE>
References: <blg2c8$jtn$1 AT titan DOT btinternet DOT com>
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 <jason DOT carney1 AT btinternet DOT com> 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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019