I'm sure this is going to be a silly question....
I'm trying to send a response from server to client. I am creating a buffer called response, copying the first value in and appending values that follow.
Code:
char response[MAX];
strcpy(response, protocol); // value of protocol is HTTP/1.1
strcat(response, " ");
strcat(response, "200 OK");
strcat(response, "\n");
printf("Response: %s\n", response);
send(nsk, response, strlen(response), 0);
When it's received by the client I get:
As you can see the " 200 OK\n" appear to have overwritten "Response: HTTP/1.1"
I've tried a few different things. Any thoughts?