mirror of
https://github.com/curl/curl.git
synced 2026-07-30 01:58:05 +03:00
examples: check more errors, fix cleanups, scope variables
Inspired by Joshua's report on examples. Closes #19055
This commit is contained in:
parent
61dcb56743
commit
64ed2ea196
42 changed files with 874 additions and 785 deletions
|
|
@ -105,10 +105,13 @@ int main(int argc, char **argv)
|
|||
|
||||
#ifdef UNDER_CE
|
||||
/* !checksrc! disable BANNEDFUNC 1 */
|
||||
stat(file, &file_info);
|
||||
if(stat(file, &file_info) != 0) {
|
||||
#else
|
||||
fstat(fileno(fp), &file_info);
|
||||
if(fstat(fileno(fp), &file_info) != 0) {
|
||||
#endif
|
||||
fclose(fp);
|
||||
return 1; /* cannot continue */
|
||||
}
|
||||
|
||||
/* In Windows, this inits the Winsock stuff */
|
||||
res = curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue