diff options
Diffstat (limited to 'deps/http_parser/contrib')
-rw-r--r-- | deps/http_parser/contrib/parsertrace.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/deps/http_parser/contrib/parsertrace.c b/deps/http_parser/contrib/parsertrace.c index e7153680f46..c9bc71ec017 100644 --- a/deps/http_parser/contrib/parsertrace.c +++ b/deps/http_parser/contrib/parsertrace.c @@ -111,14 +111,14 @@ int main(int argc, char* argv[]) { FILE* file = fopen(filename, "r"); if (file == NULL) { perror("fopen"); - goto fail; + return EXIT_FAILURE; } fseek(file, 0, SEEK_END); long file_length = ftell(file); if (file_length == -1) { perror("ftell"); - goto fail; + return EXIT_FAILURE; } fseek(file, 0, SEEK_SET); @@ -126,7 +126,7 @@ int main(int argc, char* argv[]) { if (fread(data, 1, file_length, file) != (size_t)file_length) { fprintf(stderr, "couldn't read entire file\n"); free(data); - goto fail; + return EXIT_FAILURE; } http_parser_settings settings; @@ -149,12 +149,8 @@ int main(int argc, char* argv[]) { "Error: %s (%s)\n", http_errno_description(HTTP_PARSER_ERRNO(&parser)), http_errno_name(HTTP_PARSER_ERRNO(&parser))); - goto fail; + return EXIT_FAILURE; } return EXIT_SUCCESS; - -fail: - fclose(file); - return EXIT_FAILURE; } |