Look at your asub and bsub right before returning an answer. (you can use print to see what they are). Looks like they're getting re-defined for each i rather than accumulating a list of all possible options.
You have some substrings that are shorter than the others because there are no n characters left at index i.
How many substrings of length n can you have in a string of length len(a)? n is part of the formula that goes into the range call.
I'm going to guess that your code simply returns true for every word checked, since the first line of code in the function is return true; and there's no other return true in the check function. If you fix this, and the problem persists, please edit the question, replacing the posted code with the new code.
Programming tip: Look at the documentation for ...
Check the list extract returns. Its last elements are a bit too short, as there are no len(string) substrings of length num, their number also depends on num itself. You should probably adjust your loop.
(Assuming this is python ...)
Technically, the problem is in the line
lista = set(x.append(a[i:i+n]))
You append something to a list, and you try to convert the result into a set. However, the result of the append method is None.
To get that code technically working, you should split that line up into one line which appends the character to the list, and ...
hashtable[i] = malloc(sizeof(node));
hashtable[i]-> next = NULL;
makes no sense to me. Why create a node if you don't have content for it yet?
The hashtable[i] = NULL; also doesn't add much, as global variables are guaranteed to start initialised to zero (unlike function-scope variables).
Within the loop, you then replace the word ...
Are you sure the problem is with strstr? Did you use debug50 or gdb to make sure everything is as you expect? Did you read the man page on fgets? Of particular interest:
fgets() reads in at most one less than size characters from stream and stores them into the buffer pointed to by s.
Reading stops after an EOF or a newline. If a newline ...