1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

warc: fix format string for off_t in CDX function.

This commit is contained in:
Gijs van Tulder 2012-11-24 12:44:14 +01:00 committed by Giuseppe Scrivano
parent 1e229375aa
commit 359dd16760
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2012-11-24 Gijs van Tulder <gvtulder@gmail.com>
* warc.c (warc_write_cdx_record): Use `number_to_string' to
convert the offset to a string.
2012-11-24 Giuseppe Scrivano <gscrivano@gnu.org> 2012-11-24 Giuseppe Scrivano <gscrivano@gnu.org>
* warc.c (warc_write_block_from_file): Use `number_to_string' to * warc.c (warc_write_block_from_file): Use `number_to_string' to

View File

@ -1225,10 +1225,14 @@ warc_write_cdx_record (const char *url, const char *timestamp_str,
if (redirect_location == NULL || strlen(redirect_location) == 0) if (redirect_location == NULL || strlen(redirect_location) == 0)
redirect_location = "-"; redirect_location = "-";
char offset_string[22];
number_to_string (offset_string, offset);
/* Print the CDX line. */ /* Print the CDX line. */
fprintf (warc_current_cdx_file, "%s %s %s %s %d %s %s - %ld %s %s\n", url, fprintf (warc_current_cdx_file, "%s %s %s %s %d %s %s - %s %s %s\n", url,
timestamp_str_cdx, url, mime_type, response_code, checksum, timestamp_str_cdx, url, mime_type, response_code, checksum,
redirect_location, offset, warc_current_filename, response_uuid); redirect_location, offset_string, warc_current_filename,
response_uuid);
fflush (warc_current_cdx_file); fflush (warc_current_cdx_file);
return true; return true;