My next guess would be that your buffers sizes are too small or
incorrect. Does changing PARSE_SIZE_LIMIT to a larger value, say
512 or 4096, fix the problem? If so, your buffers are too small.
<sniped>
Other suggestions or possible issues in the code below.
> #define PARSE_SIZE_LIMIT 81
#define PARSE_SIZE_LIMIT 81
This should probably be split into two defines. This is to make
sure the allocated buffer or character array is _always_ larger
than the quantity read or written to the buffer. Use one define
for the character arrays and another for the buffer size. They
should be slightly larger by at least two chars for the DOS
newline:
#define PARSE_SIZE_LIMIT 80
#define BUFFER_SIZE 82
So, any place you declare a variable that used PARSE_SIZE_LIMIT,
it would be changed to use BUFFER_SIZE:
Change:
char variable[PARSE_SIZE_LIMIT]
To:
char variable[BUFFER_SIZE]
This would be done for the declarations of the following
variables:
target, worda, uword in main()
subject in string_parser()
line in kfgets()
Leave the other non-declaration uses of PARSE_SIZE_LIMIT alone.