X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=mktag.c;h=931011121e7276513b55fc41691c65a0d924119d;hb=566842f62bdf1f16c2e94fb431445d2e6c0f3f0b;hp=be23e589fbf504cb165abc3b97bdf5adb7317f68;hpb=efced1e06e475c6e7c0b1ba0eaedf7046c01cde5;p=git.git diff --git a/mktag.c b/mktag.c index be23e589f..931011121 100644 --- a/mktag.c +++ b/mktag.c @@ -27,13 +27,13 @@ static int verify_object(unsigned char *sha1, const char *expected_type) { int ret = -1; - char type[100]; + enum object_type type; unsigned long size; - void *buffer = read_sha1_file(sha1, type, &size); + void *buffer = read_sha1_file(sha1, &type, &size); if (buffer) { - if (!strcmp(type, expected_type)) - ret = check_sha1_signature(sha1, buffer, size, type); + if (type == type_from_string(expected_type)) + ret = check_sha1_signature(sha1, buffer, size, expected_type); free(buffer); } return ret; @@ -119,7 +119,7 @@ static int verify_tag(char *buffer, unsigned long size) int main(int argc, char **argv) { unsigned long size = 4096; - char *buffer = malloc(size); + char *buffer = xmalloc(size); unsigned char result_sha1[20]; if (argc != 1)