1

three problems: char* buffer = malloc(sizeof(line)); It is quite probable that we are not reserving enough memory, better to do: char* buffer = malloc(strlen(line) + 1); the use of strtok is incorrect, the pointers returned by strtok are as follows: firstsp "GET" scndsp "/cat.html" thirdsp "HTTP/1.1\r\n" ver "HTTP/1.1\r\n" We only need ...


Only top voted, non community-wiki answers of a minimum length are eligible