]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
lib: fix gcc warning in certain debug builds
authorViktor Szakats <commit@vsz.me>
Mon, 20 May 2024 12:21:05 +0000 (14:21 +0200)
committerViktor Szakats <commit@vsz.me>
Mon, 27 May 2024 20:26:45 +0000 (22:26 +0200)
```
curl/lib/http_aws_sigv4.c:536:10: error: 'clock' may be used uninitialized [-Werror=maybe-uninitialized]
  536 |   time_t clock;
      |          ^~~~~
```
Ref: https://github.com/curl/curl/actions/runs/9158755123/job/25177765000#step:13:79

Cherry-picked from #13718
Closes #13800

lib/http_aws_sigv4.c

index 98cc033a08346306ae23ee1b033e19ebfc9d28cc..27c95d47fe8bd57247a502bd973ba90fed415e02 100644 (file)
@@ -668,7 +668,7 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy)
       time(&clock);
   }
 #else
-  time(&clock);
+  clock = time(NULL);
 #endif
   result = Curl_gmtime(clock, &tm);
   if(result) {