1 2 3 4 5 6 7 8 9 10 11 12 | #include <stdio.h> #define _GNU_SOURCE #include <string.h> int main() { char buffer[100] = "Something-something Content-Length: nnnn"; char *tmpcp; tmpcp = strcasestr(buffer, "Content-Length:"); printf("%p \n%p\n",tmpcp,buffer); } |
I2luY2x1ZGUgPHN0ZGlvLmg+CiNkZWZpbmUgIF9HTlVfU09VUkNFCiNpbmNsdWRlIDxzdHJpbmcuaD4KCmludCBtYWluKCkKewogICAgY2hhciBidWZmZXJbMTAwXSA9ICJTb21ldGhpbmctc29tZXRoaW5nIENvbnRlbnQtTGVuZ3RoOiBubm5uIjsKICAgIGNoYXIgKnRtcGNwOwogICAgdG1wY3AgPSBzdHJjYXNlc3RyKGJ1ZmZlciwgIkNvbnRlbnQtTGVuZ3RoOiIpOwogICAgcHJpbnRmKCIlcCBcbiVwXG4iLHRtcGNwLGJ1ZmZlcik7Cn0K
cc1: warnings being treated as errors prog.c: In function ‘main’: prog.c:9: error: implicit declaration of function ‘strcasestr’ prog.c:9: error: assignment makes pointer from integer without a cast
-
result: Compilation error (maybe you wish to see an example for C99 strict)


