Mail Archives: djgpp/1998/09/02/18:29:44
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
>
- Raw text -