View Single Post
  #3  
Old 08-30-2006, 05:07
leosmi05 leosmi05 is offline
Friend
 
Join Date: Feb 2005
Posts: 26
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 0 Times in 0 Posts
leosmi05 Reputation: 0
Just some small remarks regarding your program.
It seems that it can not handle well an extension of 1 or 2 characters or more than 3 characters.
You should start from the back of the file name (argv[1]) and search for the last point '.' character.

And BTW, you don't need to use strcat in case you have at least 3 characters for extension. Just find the last '.' in the name and replace the next 4 characters with "BAK" and '\0'.

The other remarks from piccolo also remain.
Reply With Quote