I'm having a problem with finding a substring count for finding a string of characters in a text file. For example, if the user enters the pattern 'the' to search for then the following words in a text file should return true: 'the', 'mother', 'then', 'their' but not 'The'.

My problem is that if the user types in a string such as 'net' to search and if a pattern of 'net' characters appears more than once, it is only counting some of the occurrences of 'st' in the file and not all of them. That particular pattern occurs almost 15 times in the attached data file that I've included with this post (data.txt) yet it only returns a count of 6.

For example, what should be happening is if the user were to enter a search of 'st', I'd need a method of finding the string of 'st' not only in words such as 'street' or 'against' where the string occurs at the start or end of the word but also in words such as 'christmas' where 'st' occurs right in the middle of a string too.

Here is the code I have so far:

Code:
FILE *fp;
fp = fopen("data.txt", "r");
char temp[256]; // reads a line from the file
char *searchStr;
int found = 0;
printf("Enter a string to search for : ");
scanf("%s", *&searchStr);

while (fgets(temp, 256, fp) != NULL) {
    if ((strstr(temp, searchStr)) != NULL) {
          found++;
    }
}

printf("\n\nThe string %s appeared %d times in the file", searchStr, found);
If anyone has advice or suggestions, feel free to post them. Any help would be greatly appreciated. I've included my own sample text data file which I created for reference.