Skip to content

Commit

Permalink
fix off-by-one error introduced in owntracks#328 (Safari only)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmens authored and wollew committed Feb 2, 2022
1 parent 245ef4a commit cd4a0b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion http.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ static int json_response(struct mg_connection *conn, JsonNode *json)
size_t content_length = strlen(js);
int length = snprintf(NULL, 0, "%zu", content_length);
char buffer[length + 1];
snprintf(buffer, length, "%zu", content_length);
snprintf(buffer, length + 1, "%zu", content_length);
mg_send_header(conn, "Content-Length", buffer);
mg_printf_data(conn, js);
free(js);
Expand Down

0 comments on commit cd4a0b5

Please sign in to comment.