git-verify-pack: get rid of while loop
[gitweb.git] / index-pack.c
index b39953dc698aae25f79caa9553e13bca6cd4e986..a91e39ecd6469c04da92391bdb24e5a05691b617 100644 (file)
@@ -447,7 +447,7 @@ int main(int argc, char **argv)
                usage(index_pack_usage);
        if (!index_name) {
                int len = strlen(pack_name);
-               if (len < 5 || strcmp(pack_name + len - 5, ".pack"))
+               if (!has_extension(pack_name, len, ".pack"))
                        die("packfile name '%s' does not end with '.pack'",
                            pack_name);
                index_name_buf = xmalloc(len);