]> granicus.if.org Git - curl/commitdiff
examples/sftpuploadresume: Value stored to 'result' is never read
authorDaniel Stenberg <daniel@haxx.se>
Thu, 14 Feb 2019 11:30:25 +0000 (12:30 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 14 Feb 2019 22:30:44 +0000 (23:30 +0100)
Detected by scan-build

docs/examples/sftpuploadresume.c

index 6e60c1e57b46c26ddb2f0f0979915e413b1b630c..98f3b62f04cbdb7a33092312f5458c82075a68bc 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -65,6 +65,8 @@ static curl_off_t sftpGetRemoteFileSize(const char *i_remoteFile)
     result = curl_easy_getinfo(curlHandlePtr,
                                CURLINFO_CONTENT_LENGTH_DOWNLOAD_T,
                                &remoteFileSizeByte);
+    if(result)
+      return -1;
     printf("filesize: %" CURL_FORMAT_CURL_OFF_T "\n", remoteFileSizeByte);
   }
   curl_easy_cleanup(curlHandlePtr);