clone: use computed length in guess_dir_name
[gitweb.git] / builtin / clone.c
index e18839d1077aaa383f601429541f2fc25972f36c..ed484cb6f488883872be7cde82c67d12cebeab4e 100644 (file)
@@ -174,7 +174,8 @@ static char *guess_dir_name(const char *repo, int is_bundle, int is_bare)
        /*
         * Strip .{bundle,git}.
         */
-       strip_suffix(start, is_bundle ? ".bundle" : ".git" , &len);
+       len = end - start;
+       strip_suffix_mem(start, &len, is_bundle ? ".bundle" : ".git");
 
        if (is_bare)
                dir = xstrfmt("%.*s.git", (int)len, start);