tree-diff: don't access hash of NULL object_id pointer
[gitweb.git] / tag.c
diff --git a/tag.c b/tag.c
index eb7b146f4a830d98e0103d66f107a102a38bcc06..47f60ae151c2cfd9855d1b6f1660ec2ba178bec3 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -97,7 +97,7 @@ struct tag *lookup_tag(const struct object_id *oid)
        return object_as_type(obj, OBJ_TAG, 0);
 }
 
-static unsigned long parse_tag_date(const char *buf, const char *tail)
+static timestamp_t parse_tag_date(const char *buf, const char *tail)
 {
        const char *dateptr;
 
@@ -110,8 +110,8 @@ static unsigned long parse_tag_date(const char *buf, const char *tail)
                /* nada */;
        if (buf >= tail)
                return 0;
-       /* dateptr < buf && buf[-1] == '\n', so strtoul will stop at buf-1 */
-       return strtoul(dateptr, NULL, 10);
+       /* dateptr < buf && buf[-1] == '\n', so parsing will stop at buf-1 */
+       return parse_timestamp(dateptr, NULL, 10);
 }
 
 int parse_tag_buffer(struct tag *item, const void *data, unsigned long size)