This call:
Would that fail in any way if one of the buffers are empty? I get a runtime error (the infamour XP runtime error dialog).Code:strncpy(entry_buf, strstr(file_buf, sought_buf), MAX_ENTRY_LEN);
Printable View
This call:
Would that fail in any way if one of the buffers are empty? I get a runtime error (the infamour XP runtime error dialog).Code:strncpy(entry_buf, strstr(file_buf, sought_buf), MAX_ENTRY_LEN);
Well if strstr() doesn't find anything, then you're in doo-doo because it returns a NULL pointer.
Plus strncpy() doesn't always append a \0 to the string, so if you're assuming that as well, then that could be another problem.
Assuming of course that you've allocated the amount of space you say you have.