]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
libtest: avoid "assignment within conditional expression"
authorDaniel Stenberg <daniel@haxx.se>
Mon, 3 Jan 2022 15:39:45 +0000 (16:39 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 3 Jan 2022 16:05:36 +0000 (17:05 +0100)
In lib530, lib540 and lib582

Closes #8218

tests/libtest/lib530.c
tests/libtest/lib540.c
tests/libtest/lib582.c

index 3d31f3d0d8865e9a5c0e9f881458d0300b220d7c..d9d10de7795442837ea5fe393ff29890403f555a 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -175,11 +175,13 @@ static int curlTimerCallback(CURLM *multi, long timeout_ms, void *userp)
  */
 static int checkForCompletion(CURLM *curl, int *success)
 {
-  int numMessages;
-  CURLMsg *message;
   int result = 0;
   *success = 0;
-  while((message = curl_multi_info_read(curl, &numMessages))) {
+  while(1) {
+    int numMessages;
+    CURLMsg *message = curl_multi_info_read(curl, &numMessages);
+    if(!message)
+      break;
     if(message->msg == CURLMSG_DONE) {
       result = 1;
       if(message->data.result == CURLE_OK)
index 2e5885ff23471ead8de098eab69231336b14e802..d34029d849f36c79fc3f3a7a3ed33654c9fe0cdf 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -155,7 +155,10 @@ static int loop(int num, CURLM *cm, const char *url, const char *userpwd,
         return res;
     }
 
-    while((msg = curl_multi_info_read(cm, &Q))) {
+    while(1) {
+      msg = curl_multi_info_read(cm, &Q);
+      if(!msg)
+        break;
       if(msg->msg == CURLMSG_DONE) {
         int i;
         CURL *e = msg->easy_handle;
index 031793d6a60f36ffac6ea0bee091743534d76880..135aa1ad08e4a1236bbf22a352d6325c78d57fec 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, 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
@@ -147,11 +147,13 @@ static int curlTimerCallback(CURLM *multi, long timeout_ms, void *userp)
  */
 static int checkForCompletion(CURLM *curl, int *success)
 {
-  int numMessages;
-  CURLMsg *message;
   int result = 0;
   *success = 0;
-  while((message = curl_multi_info_read(curl, &numMessages))) {
+  while(1) {
+    int numMessages;
+    CURLMsg *message = curl_multi_info_read(curl, &numMessages);
+    if(!message)
+      break;
     if(message->msg == CURLMSG_DONE) {
       result = 1;
       if(message->data.result == CURLE_OK)