src/server/util/uri.c

branch
cpp-ports
changeset 364
e56f9c6f6b8f
parent 362
e45f218628cd
child 386
b91f8efadb63
--- a/src/server/util/uri.c	Wed Jun 08 18:55:59 2022 +0200
+++ b/src/server/util/uri.c	Wed Jun 08 19:14:57 2022 +0200
@@ -464,21 +464,19 @@
     }
 
 done:
-    int canonLen = 0;
 
     if (success) {
         /* the path looks fine; return the canonicalized form */
-        canonLen = (int) (out_ptr - canonPath);
+        unsigned canonLen = (unsigned) (out_ptr - canonPath);
         canonPath[canonLen] = '\0';
+        if (pcanonlen) *pcanonlen = (int) canonLen;
     } else {
         /* error canonicalizing */
         pool_free(pool, canonPath);
         canonPath = NULL;
+        if (pcanonlen) *pcanonlen = 0;
     }
 
-    if (pcanonlen)
-        *pcanonlen = canonLen;
-
     return canonPath;
 }
 

mercurial