Making strcasestr more friendly.
This commit is contained in:
parent
b02f0c3b68
commit
f506097ac7
1 changed files with 4 additions and 1 deletions
|
|
@ -208,7 +208,10 @@ char *strcasestr(const char *haystack, const char *needle)
|
|||
|
||||
result = strstr(uphaystack, upneedle);
|
||||
|
||||
return (result - uphaystack + (char *) haystack);
|
||||
if (result != NULL)
|
||||
return (result - uphaystack + (char *) haystack);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue