|
From: | Giuseppe Scrivano |
Subject: | Re: [Bug-wget] [PATCH] Invalid Content-Length header in WARC files, on some platforms |
Date: | Mon, 26 Nov 2012 00:04:52 +0100 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) |
Ángel González <address@hidden> writes: > On 24/11/12 12:32, Giuseppe Scrivano wrote: >> I have pushed the following patch: > >> + char content_length[22]; > The 22 is a magic number, based in the fact > that 1e21 > INT64_MAX > > I think it should be #defined in wget.h > > It could be defined variable depending on the > different MAX values, eg. sizeof( STRINGIZE( INT64_MAX ) ) that is a good idea, we can add something like: #define MAX_INT_TO_STRING_LEN(x) (sizeof(x) * 24082 / 10000) + 2 where `x' in our case will be off_t. I am not sure if such a function already exists somewhere. Does it improve readability? Giuseppe
[Prev in Thread] | Current Thread | [Next in Thread] |