]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
urlapi: skip a pointless assign
authorDaniel Stenberg <daniel@haxx.se>
Thu, 13 Apr 2023 07:23:01 +0000 (09:23 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 13 Apr 2023 12:36:28 +0000 (14:36 +0200)
It stores a null byte after already having confirmed there is a null
byte there. Detected by PVS.

Ref: #10929
Closes #10943

lib/urlapi.c

index e45d056bca499629fd7cf95a94f0aabaa6ddb35b..15e31ec6d153e4a68796b91d81d7a29804dbcc24 100644 (file)
@@ -541,7 +541,6 @@ UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, struct dynbuf *host,
     if(rest[0])
       return CURLUE_BAD_PORT_NUMBER;
 
-    *rest = 0;
     u->portnum = port;
     /* generate a new port number string to get rid of leading zeroes etc */
     u->port = aprintf("%ld", port);