Refactor handling of error_string in receive-pack
[gitweb.git] / builtin-fsck.c
index 6da3814d59a2c04cbcc9853035f5d72c0a3a4928..39cfc32818dc80d8bda04ff45fbf5996d1506922 100644 (file)
@@ -546,7 +546,7 @@ static int fsck_head_link(void)
 
        if (!head_points_at || !(flag & REF_ISSYMREF))
                return error("HEAD is not a symbolic ref");
-       if (strncmp(head_points_at, "refs/heads/", 11))
+       if (prefixcmp(head_points_at, "refs/heads/"))
                return error("HEAD points to something strange (%s)",
                             head_points_at);
        if (is_null_sha1(sha1))
@@ -632,7 +632,7 @@ int cmd_fsck(int argc, char **argv, const char *prefix)
                        verify_pack(p, 0);
 
                for (p = packed_git; p; p = p->next) {
-                       int num = num_packed_objects(p);
+                       uint32_t i, num = num_packed_objects(p);
                        for (i = 0; i < num; i++) {
                                unsigned char sha1[20];
                                nth_packed_object_sha1(p, i, sha1);