delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/12/12/09:02:52

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: Waldemar Schultz <schultz AT ma DOT tum DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: gcc bug or am I blind?
Date: Wed, 12 Dec 2001 14:51:15 +0100
Organization: [posted via] Leibniz-Rechenzentrum, Muenchen (Germany)
Lines: 22
Message-ID: <3C1760D3.B8614BE6@ma.tum.de>
References: <3C17418A DOT 85364005 AT ma DOT tum DOT de> <3C174718 DOT EF323B32 AT ma DOT tum DOT de> <9v7iem$54q$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
NNTP-Posting-Host: pcritter14.mathematik.tu-muenchen.de
Mime-Version: 1.0
X-Trace: wsc10.lrz-muenchen.de 1008165071 18986 131.159.68.151 (12 Dec 2001 13:51:11 GMT)
X-Complaints-To: news AT lrz-muenchen DOT de
NNTP-Posting-Date: 12 Dec 2001 13:51:11 GMT
X-Mailer: Mozilla 4.75 [de] (Win98; U)
X-Accept-Language: de,en-US
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hans-Bernhard Broeker schrieb:
> 
> Waldemar Schultz <schultz AT ma DOT tum DOT de> wrote:
> > --snip
> >>   dest=realloc(dest,strlen(arg)*sizeof(*dest));
> 
> > of course:   dest=realloc(dest,(1+strlen(arg))*sizeof(*dest));
> > but the problem persists.
> 
> The realloc() call ist still *very* wrong.  You're forgetting the space
> that dest already needs.  The second argument would have to be:
> 
>         (strlen(dest)+strlen(arg)+1)*(sizeof(*dest)

shame on me, seems I was blid, once you look over a thing, you are
stuck...
many thanks anyway. Danke Hans-Berhard und Rob.

-- 
 Gruss Waldemar Schultz.         schultz AT ma DOT tum DOT de
 Technische Universität München, Zentrum Mathematik M1, D 80290 München
 Tel: +49 (0)89 2892 8226        FAX: +49 (0)89 2892 8228

- Raw text -


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