]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ws: fix a C89 compliance nit
authorDaniel Stenberg <daniel@haxx.se>
Tue, 20 Sep 2022 08:54:22 +0000 (10:54 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 21 Sep 2022 07:19:42 +0000 (09:19 +0200)
Closes #9541

lib/ws.c

index e68d0f4fff9fee1fcb7a2bc1ce8f8925a3ef7243..cec3162d9b04c3cea32cd83e0590d3a3b08c33b9 100644 (file)
--- a/lib/ws.c
+++ b/lib/ws.c
@@ -56,7 +56,7 @@ CURLcode Curl_ws_request(struct Curl_easy *data, REQTYPE *req)
   size_t randlen;
   char keyval[40];
   struct SingleRequest *k = &data->req;
-  const struct wsfield heads[]= {
+  struct wsfield heads[]= {
     {
       /* The request MUST contain an |Upgrade| header field whose value
          MUST include the "websocket" keyword. */
@@ -79,9 +79,10 @@ CURLcode Curl_ws_request(struct Curl_easy *data, REQTYPE *req)
          consisting of a randomly selected 16-byte value that has been
          base64-encoded (see Section 4 of [RFC4648]). The nonce MUST be
          selected randomly for each connection. */
-      "Sec-WebSocket-Key:", &keyval[0]
+      "Sec-WebSocket-Key:", NULL,
     }
   };
+  heads[3].val = &keyval[0];
 
   /* 16 bytes random */
   result = Curl_rand(data, (unsigned char *)rand, sizeof(rand));