X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=sha1-file.c;h=4a67e0e75945e362c64061f56f1ccb959396f102;hb=ca473cef9140f55d68d6758fe226ef47c216669c;hp=dd0b6aa873a95433906b52abf605a43acc924d4a;hpb=8858448bb49332d353febc078ce4a3abcc962efe;p=thirdparty%2Fgit.git diff --git a/sha1-file.c b/sha1-file.c index dd0b6aa873..4a67e0e759 100644 --- a/sha1-file.c +++ b/sha1-file.c @@ -833,7 +833,7 @@ int check_object_signature(const struct object_id *oid, void *map, return -1; /* Generate the header */ - hdrlen = xsnprintf(hdr, sizeof(hdr), "%s %lu", type_name(obj_type), size) + 1; + hdrlen = xsnprintf(hdr, sizeof(hdr), "%s %"PRIuMAX , type_name(obj_type), (uintmax_t)size) + 1; /* Sha1.. */ the_hash_algo->init_fn(&c); @@ -1492,7 +1492,7 @@ static void write_object_file_prepare(const void *buf, unsigned long len, git_hash_ctx c; /* Generate the header */ - *hdrlen = xsnprintf(hdr, *hdrlen, "%s %lu", type, len)+1; + *hdrlen = xsnprintf(hdr, *hdrlen, "%s %"PRIuMAX , type, (uintmax_t)len)+1; /* Sha1.. */ the_hash_algo->init_fn(&c); @@ -1758,7 +1758,7 @@ int force_object_loose(const struct object_id *oid, time_t mtime) buf = read_object(oid->hash, &type, &len); if (!buf) return error(_("cannot read sha1_file for %s"), oid_to_hex(oid)); - hdrlen = xsnprintf(hdr, sizeof(hdr), "%s %lu", type_name(type), len) + 1; + hdrlen = xsnprintf(hdr, sizeof(hdr), "%s %"PRIuMAX , type_name(type), (uintmax_t)len) + 1; ret = write_loose_object(oid, hdr, hdrlen, buf, len, mtime); free(buf);