From: "Rainer Temme" Newsgroups: comp.os.msdos.djgpp,comp.lang.c Subject: Re: x/0, and a problem with realloc Date: 30 Jan 1998 09:33:09 GMT Organization: Siemens Nixdorf Inc. Lines: 16 Message-ID: <01bd2d62$5c293010$2f9bca95@samos_pc2> References: NNTP-Posting-Host: 149.202.155.47 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Original posting was about problems regarding calloc() / realloc() > CrArray=calloc(CrInFile, sizeof(long) later on > CrArray=realloc(CrArray, j) > /* This line seems to be causing problems - > * my array doesn't come out right... it gets mangled */ Regarding the code, I assume "j" is an index into the allocated array... If this is the case, your realloc has to be realloc(CrArray,j*sizeof(long)) Regards Rainer