Message-ID: <915C65C50371D11187AD0000F881B9A401858C63@bcarua62.ca.nortel.com> From: "Ian Chapman" To: "'Endlisnis'" Cc: "'djgpp AT delorie DOT com'" Subject: RE: system Date: Wed, 2 Sep 1998 18:27:20 -0400 MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk Many thanks it's fine now. Regards Ian. > ---------- > From: Endlisnis[SMTP:s257m AT unb DOT ca] > Sent: Wednesday, September 02, 1998 6:04 PM > To: Chapman, Ian [CAR:TM14:EXCH] > Subject: Re: system > > Ian Chapman wrote: > > char temp[20]; //50 or 100 > > char *ptr; > > ptr = &File_Log[n][0]; > > strcpy(temp, "ren temp.pad "); > > strcat(temp, ptr); // ren temp.pad blah_blah. > You only allocate a string of length 19, then you put "ren temp.pad > somefile.ext" in it, which is 25 characters and will take 26 bytes. You > should make your 'temp' larger, or dynamic. If you are using Win95 LFN's > then > you might need to make it MUCH larger (or you will get problems like in > RHIDE). > > // *** n = 1 at this point > > Junk = system(temp); > > // *** n = 0 here and clobbers the loop. > your string overwrote the long. > > cout << "Padded " << ptr << endl; > > } > > } // End for loop > > } //End of Pad Sorted Files > > -- > (\/) Endlisnis (\/) > s257m AT unb DOT ca > Endlisnis AT GeoCities DOT com > Endlis AT nbnet DOT nb DOT ca >