View Single Post
  #2 (permalink)  
Old November 5th, 2007, 05:46 AM
weicco weicco is offline
Authorized User
 
Join Date: Sep 2007
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hmm. How about just rewinding like:

fseek(fpInFileNext,-(cnt+3),SEEK_CUR);

I think the problem comes from new-line character (\r\n in Windows, \n in *nix) so you need to rewind past those also. I'm not sure where the third character comes from (too little coffeiine, can't think straight). If you are writing portable code you propably need to do some evil precompilter thingy:

#if _WIN32_
fseek(fpInFileNext,-(cnt+3),SEEK_CUR);
#else
fseek(fpInFileNext,-(cnt+2),SEEK_CUR);
#endif

Or something like that.

Reply With Quote