I'm using 'fseek' and 'fputs' to edit the contents of a text file.
Below is the code I'm using.
It basically searches the file for the line that contains ABCDEFGH.
It then overwrites that with ZZZZZZZZ.
It works OK except that there is a strange character inserted after the ZZZZZZZZ. (And the overwrite extends a few characters further.)
When I say strange, it appears in the text file as small black rectangle.
It doesn't want to be copy and pasted ...if that makes sense!
Let me put it this way.
Assume that the # in this line is the strange character:
1234567XXXXXX54321ZZZZZZZZ#123456789.
If I highlight that whole line, and then paste it, I only see everything up to the #. The last series of digits don't appear!
What could be the problem.
Thanks.
PS. The -81 in the 'fseek' refers to the fact that the overwrite point is 81 characters back from where the position locator is currently sitting.