Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Commit

Permalink
src: put assert() after var declarations
Browse files Browse the repository at this point in the history
Microsoft C++ compiler fails when this assert appears before the
declarations. Moved assert to appear after the declarations.

PR-URL: #293
Reviewed-By: Fedor Indutny <[email protected]>
  • Loading branch information
Jonathan Marler authored and indutny committed Apr 25, 2016
1 parent 9b0d5b3 commit f2c26ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion http_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -2253,12 +2253,13 @@ http_parse_host_char(enum http_host_state s, const char ch) {

static int
http_parse_host(const char * buf, struct http_parser_url *u, int found_at) {
assert(u->field_set & (1 << UF_HOST));
enum http_host_state s;

const char *p;
size_t buflen = u->field_data[UF_HOST].off + u->field_data[UF_HOST].len;

assert(u->field_set & (1 << UF_HOST));

u->field_data[UF_HOST].len = 0;

s = found_at ? s_http_userinfo_start : s_http_host_start;
Expand Down

0 comments on commit f2c26ee

Please sign in to comment.