diff options
-rwxr-xr-x | examples/nanohttp/mime_client.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/nanohttp/mime_client.c b/examples/nanohttp/mime_client.c index ffa8de7..b6fe8b0 100755 --- a/examples/nanohttp/mime_client.c +++ b/examples/nanohttp/mime_client.c @@ -118,7 +118,7 @@ int main(int argc, char **argv) if (argc < 5) { fprintf(stderr, "usage %s <url> <file> <id> <content-type>\n", argv[0]); - exit(1); + return -1; } /* Set log level to see more information written by the library */ @@ -129,7 +129,7 @@ int main(int argc, char **argv) { fprintf(stderr, "Cannot init httpc (%s)\n", herror_message(status)); herror_release(status); - return 1; + return -1; } /* Create the client connection object */ @@ -144,13 +144,13 @@ int main(int argc, char **argv) { fprintf(stderr, "Can not start MIME: %s\n", herror_message(status)); herror_release(status); - exit(1); + return -1; } if (!send_file(conn, argv[2], argv[3], argv[4])) { fprintf(stderr, "send_file failed\n"); - exit(1); + return -1; } while (1) @@ -166,14 +166,14 @@ int main(int argc, char **argv) gets(content_type); if (!send_file(conn, file, id, content_type)) - exit(1); + return -1; } if ((status = httpc_mime_end(conn, &res)) != H_OK) { fprintf(stderr, "httpc_mime_end failed (%s)\n", herror_message(status)); herror_release(status); - exit(1); + return -1; } /* Show response */ |