http-parser.c

Small C library to parse HTTP requests
Log | Files | Refs | README | LICENSE

commit 043cb7b959eb4f64119ee83961c336420f7a13f0
parent 1b603c62abd84f9282b8f23f93949df69b1746ee
Author: finwo <finwo@pm.me>
Date:   Wed,  4 Nov 2020 20:29:37 +0100

Fix blank response bug

Diffstat:
Msrc/http-parser.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/http-parser.c b/src/http-parser.c @@ -342,7 +342,7 @@ char * http_parser_sprint_response(struct http_parser_message *response) { length = index + response->bodysize; result = realloc(result, length + 1); *(result + length) = '\0'; - memcpy( result + index + 2, response->body, response->bodysize ); + memcpy( result + index, response->body, response->bodysize ); return result; }