Hi,
I have the following code:
#include <stdio.h>
int main(void){
char* str1 = "abc";
char* str2 = '\0';
if ( strstr(str1, str2) == NULL ){
printf("yes\n") ;
}
else{
printf("no\n");
}
return 0;
}
It crashes on strstr() call, so is it because none of strstr()
parameter can be NULL?
I have the following code:
#include <stdio.h>
int main(void){
char* str1 = "abc";
char* str2 = '\0';
if ( strstr(str1, str2) == NULL ){
printf("yes\n") ;
}
else{
printf("no\n");
}
return 0;
}
It crashes on strstr() call, so is it because none of strstr()
parameter can be NULL?
Comment