diff options
author | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2023-07-09 15:39:51 -0300 |
---|---|---|
committer | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2023-07-09 16:04:33 -0300 |
commit | 3c36d76be739b6975fac4e6adee3b91002056db1 (patch) | |
tree | 82f26ce27c21cca23367b3b40849e710216ab8b2 /src/http.c | |
parent | 7a388dad85152a203033c14fee3c64607301865a (diff) |
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Diffstat (limited to 'src/http.c')
-rw-r--r-- | src/http.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -97,10 +97,7 @@ static enum parse_result parse_request(struct request *req, const char *request) line = strtok_r(copy, "\r\n", &saveptr); - path = malloc(strlen(line) + 1); - req->method = malloc(strlen(line) + 1); - - if (sscanf(line, "%s %s HTTP/%s", req->method, path, req->http_version) != 3) { + if (sscanf(line, "%ms %ms HTTP/%s", &req->method, &path, req->http_version) != 3) { free(copy); free(path); free(req->method); |