From: Giuseppe Scrivano Date: Sat, 24 Nov 2012 11:27:16 +0000 (+0100) Subject: warc: fix format string for off_t X-Git-Tag: v1.15~81 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=1e229375aa89cdc0bba07335fbe10d4f66180f68 warc: fix format string for off_t --- diff --git a/src/ChangeLog b/src/ChangeLog index cba21135..07152a57 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-11-24 Giuseppe Scrivano + + * warc.c (warc_write_block_from_file): Use `number_to_string' to + convert the content-length to a string. + 2012-11-15 Giuseppe Scrivano * retr.c (write_data): Fix comment. diff --git a/src/warc.c b/src/warc.c index de99bf7c..99e70166 100644 --- a/src/warc.c +++ b/src/warc.c @@ -245,15 +245,10 @@ static bool warc_write_block_from_file (FILE *data_in) { /* Add the Content-Length header. */ - char *content_length; + char content_length[22]; fseeko (data_in, 0L, SEEK_END); - if (! asprintf (&content_length, "%ld", ftello (data_in))) - { - warc_write_ok = false; - return false; - } + number_to_string (content_length, ftello (data_in)); warc_write_header ("Content-Length", content_length); - free (content_length); /* End of the WARC header section. */ warc_write_string ("\r\n");