]> git.ipfire.org Git - thirdparty/git.git/blobdiff - fast-import.c
fast-import: use xsnprintf for formatting headers
[thirdparty/git.git] / fast-import.c
index 9ae2053a8f822d9222e2c233d4d5ca83a6661972..87c4e7e400229390c1141c69516c42793f254bab 100644 (file)
@@ -1237,9 +1237,7 @@ static void stream_blob(uintmax_t len, unsigned char *sha1out, uintmax_t mark)
        sha1file_checkpoint(pack_file, &checkpoint);
        offset = checkpoint.offset;
 
-       hdrlen = snprintf((char *)out_buf, out_sz, "blob %" PRIuMAX, len) + 1;
-       if (out_sz <= hdrlen)
-               die("impossibly large object header");
+       hdrlen = xsnprintf((char *)out_buf, out_sz, "blob %" PRIuMAX, len) + 1;
 
        git_SHA1_Init(&c);
        git_SHA1_Update(&c, out_buf, hdrlen);