Permalink
Browse files

Merge pull request #80 from mreiferson/log_fix_80

logging segfault
  • Loading branch information...
2 parents f3d94f7 + b33d9e2 commit d9bd5e0245874e3654852fb12209082008b7f9ee @ploxiln ploxiln committed Nov 8, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 simplehttp/log.c
View
@@ -65,7 +65,7 @@ void simplehttp_log(const char *host, struct evhttp_request *req, uint64_t req_t
fprintf(stdout, "[%c %s %s] %d %s %s%s", code, datetime_buf, id, response_code, method, host, uri);
- if (display_post && (type == EVHTTP_REQ_POST)) {
+ if (display_post && (type == EVHTTP_REQ_POST) && EVBUFFER_DATA(req->input_buffer)) {
fprintf(stdout, "?");
fwrite(EVBUFFER_DATA(req->input_buffer), EVBUFFER_LENGTH(req->input_buffer), 1, stdout);
}

0 comments on commit d9bd5e0

Please sign in to comment.