X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=docs%2Fexamples%2Ffileupload.c;h=6b05c4cec72e17ab40af2b368260d27c4ba520e8;hb=e9bdad71c8277e20607fa1eaf0027d53a0dc1f37;hp=363fae69494fab1ffe9e38d611890690ee817414;hpb=3e62527ed71a7a362d7ec321e7f026edab35f8e2;p=platform%2Fupstream%2Fcurl.git diff --git a/docs/examples/fileupload.c b/docs/examples/fileupload.c index 363fae6..6b05c4c 100644 --- a/docs/examples/fileupload.c +++ b/docs/examples/fileupload.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -37,16 +37,12 @@ int main(void) FILE *fd; fd = fopen("debugit", "rb"); /* open file to upload */ - if(!fd) { - + if(!fd) return 1; /* can't continue */ - } /* to get the file size */ - if(fstat(fileno(fd), &file_info) != 0) { - + if(fstat(fileno(fd), &file_info) != 0) return 1; /* can't continue */ - } curl = curl_easy_init(); if(curl) { @@ -86,5 +82,6 @@ int main(void) /* always cleanup */ curl_easy_cleanup(curl); } + fclose(fd); return 0; }