Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Segmentation fault with NULL for strcmp and strlen

807578Jan 5 2004 — edited Feb 11 2004
Hi,

I have a C program that performs a strcmp with NULL as one of it's arguments. COmpilation is fine but when I run it, I hit segmentation fault. Can anyone help me?

Source Code
#include <string.h>

int main(){
char s1[1000];
strcpy(s1,"TEST");
return strcmp(s1,NULL);
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 10 2004
Added on Jan 5 2004
4 comments
1,105 views