i got the delimiter "\r\n\r\n" in the substring, and strstr is returning null
Here is the code :
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int ac, char **av) {
char *ptr;
ptr = strstr(av[1], "\r\n\r\n");
printf("ptr = %s\n", ptr);
return 0;
}
I launch the code with this :
./a.out "POST /cgi-bin/process.cgi HTTP/1.1\nUser-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)\nHost: www.tutorialspoint.com\nContent-Type: text/xml; charset=utf-8\nContent-Length: length\nAccept-Language: en-us\nAccept-Encoding: gzip, deflate\nConnection: Keep-Alive\r\n\r\n<?xml version='1.0' encoding='utf-8'?>"
And ptr is equal to (null), why ?