X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fwarc.c;h=fb506a7f99aee4ad9405dd0aa0207df7130dd042;hp=25a8517f2b31e848b56bf334b56da24b948f5203;hb=3ebbd84518281f348659bf8cf2d7bdc25ec4e140;hpb=359dd167602071cfa62d6c586ca846ede5ed7c29 diff --git a/src/warc.c b/src/warc.c index 25a8517f..fb506a7f 100644 --- a/src/warc.c +++ b/src/warc.c @@ -245,7 +245,7 @@ static bool warc_write_block_from_file (FILE *data_in) { /* Add the Content-Length header. */ - char content_length[22]; + char content_length[MAX_INT_TO_STRING_LEN(off_t)]; fseeko (data_in, 0L, SEEK_END); number_to_string (content_length, ftello (data_in)); warc_write_header ("Content-Length", content_length); @@ -527,7 +527,7 @@ warc_sha1_stream_with_payload (FILE *stream, void *res_block, void *res_payload, static char * warc_base32_sha1_digest (char *sha1_digest) { - // length: "sha1:" + digest + "\0" + /* length: "sha1:" + digest + "\0" */ char *sha1_base32 = malloc (BASE32_LENGTH(SHA1_DIGEST_SIZE) + 1 + 5 ); base32_encode (sha1_digest, SHA1_DIGEST_SIZE, sha1_base32 + 5, BASE32_LENGTH(SHA1_DIGEST_SIZE) + 1); @@ -1225,7 +1225,7 @@ warc_write_cdx_record (const char *url, const char *timestamp_str, if (redirect_location == NULL || strlen(redirect_location) == 0) redirect_location = "-"; - char offset_string[22]; + char offset_string[MAX_INT_TO_STRING_LEN(off_t)]; number_to_string (offset_string, offset); /* Print the CDX line. */