mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Ignore trailing whitespace in header_extract_number.
Published in <sxsheruo5gn.fsf@florida.arsdigita.de>.
This commit is contained in:
parent
3d9dda6485
commit
1a96dcfcb8
@ -1,3 +1,7 @@
|
||||
2001-11-16 Hrvoje Niksic <hniksic@arsdigita.com>
|
||||
|
||||
* headers.c (header_extract_number): Ignore trailing whitespace.
|
||||
|
||||
2001-08-24 Ian Abbott <abbotti@mev.co.uk>
|
||||
|
||||
* html-url.c (collect_tags_mapper): Fix bug converting links
|
||||
|
@ -149,6 +149,15 @@ header_extract_number (const char *header, void *closure)
|
||||
|
||||
for (result = 0; ISDIGIT (*p); p++)
|
||||
result = 10 * result + (*p - '0');
|
||||
|
||||
/* Failure if no number present. */
|
||||
if (p == header)
|
||||
return 0;
|
||||
|
||||
/* Skip trailing whitespace. */
|
||||
p += skip_lws (p);
|
||||
|
||||
/* Indicate failure if trailing garbage is present. */
|
||||
if (*p)
|
||||
return 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user