]> granicus.if.org Git - curl/commitdiff
urlapi: part of conditional expression is always true: (relurl[0] == '/')
authorDaniel Stenberg <daniel@haxx.se>
Thu, 19 Sep 2019 08:18:28 +0000 (10:18 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 20 Sep 2019 06:07:42 +0000 (08:07 +0200)
Fixes warning detected by PVS-Studio
Fixes #4374

lib/urlapi.c

index 6e414cf18cc4daa01bcca33bf356f2025307ba87..779ca3f78f562d1aeb103d21764eb09919006b0a 100644 (file)
@@ -351,7 +351,7 @@ static char *concat_url(const char *base, const char *relurl)
   else {
     /* We got a new absolute path for this server */
 
-    if((relurl[0] == '/') && (relurl[1] == '/')) {
+    if(relurl[1] == '/') {
       /* the new URL starts with //, just keep the protocol part from the
          original one */
       *protsep = 0;