]> git.proxmox.com Git - mirror_qemu.git/blobdiff - util/uri.c
cutils: Provide strchrnul
[mirror_qemu.git] / util / uri.c
index 8624a7ac23d9317a6a26abfcdb05a46bd3748c40..8bdef841208d249cb1a24116811b38d9480daa32 100644 (file)
@@ -52,6 +52,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/cutils.h"
 
 #include "qemu/uri.h"
 
@@ -2266,10 +2267,7 @@ struct QueryParams *query_params_parse(const char *query)
         /* Find the next separator, or end of the string. */
         end = strchr(query, '&');
         if (!end) {
-            end = strchr(query, ';');
-        }
-        if (!end) {
-            end = query + strlen(query);
+            end = qemu_strchrnul(query, ';');
         }
 
         /* Find the first '=' character between here and end. */