+2012-11-24 Giuseppe Scrivano <gscrivano@gnu.org>
+
+ * warc.c (warc_write_block_from_file): Use `number_to_string' to
+ convert the content-length to a string.
+
2012-11-15 Giuseppe Scrivano <gscrivano@gnu.org>
* retr.c (write_data): Fix comment.
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");