]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
lib1597: make it C89-compliant again
authorPatrick Monnerat <patrick@monnerat.net>
Sat, 17 Sep 2022 12:09:07 +0000 (14:09 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 17 Sep 2022 15:26:43 +0000 (17:26 +0200)
Automatic variable addresses cannot be used in an initialisation
aggregate.

Follow-up to 9d51329

Reported-by: Daniel Stenberg
Fixes: #9524
Closes #9525

tests/libtest/lib1597.c

index cb167e84fa7e944d9cb0e1e1de99ab1cc059fc38..cf2effaa19f6aab18007fb25310def07548bdae9 100644 (file)
@@ -38,18 +38,18 @@ int test(char *URL)
   CURL *curl = NULL;
   int res = 0;
   CURLcode result = CURLE_OK;
-  CURLcode ok = CURLE_OK;
-  CURLcode bad = CURLE_BAD_FUNCTION_ARGUMENT;
-  CURLcode unsup = CURLE_UNSUPPORTED_PROTOCOL;
-  CURLcode httpcode = CURLE_UNSUPPORTED_PROTOCOL;
-  CURLcode httpscode = CURLE_UNSUPPORTED_PROTOCOL;
   curl_version_info_data *curlinfo;
   const char *const *proto;
-  char protolist[1024];
   int n;
   int i;
+  static CURLcode ok = CURLE_OK;
+  static CURLcode bad = CURLE_BAD_FUNCTION_ARGUMENT;
+  static CURLcode unsup = CURLE_UNSUPPORTED_PROTOCOL;
+  static CURLcode httpcode = CURLE_UNSUPPORTED_PROTOCOL;
+  static CURLcode httpscode = CURLE_UNSUPPORTED_PROTOCOL;
+  static char protolist[1024];
 
-  struct pair prots[] = {
+  static const struct pair prots[] = {
     {"goobar", &unsup},
     {"http ", &unsup},
     {" http", &unsup},