Re: parse functions

From: Robert Collins <robert.collins@dont-contact.us>
Date: Tue, 30 Jan 2001 21:13:44 +1100

Just a short comment...

You could use xisspace() which is typdefed to isspace(unsigned char *) ) for easier reading...

I'm not bothered either way though :-]

Rob

----- Original Message -----
From: "Henrik Nordstrom" <hno@hem.passagen.se>
To: "Robert Collins" <robert.collins@itdomain.com.au>; "Squid-Dev (E-mail)" <squid-dev@squid-cache.org>
Sent: Tuesday, January 30, 2001 8:48 PM
Subject: Re: parse functions

> But still buggy.. in fact there was two fatal bugs in my code.
>
> The following has now been committed:
>
> --- cache_cf.c 2001/01/28 00:45:45 1.372
> +++ cache_cf.c 2001/01/30 09:43:37
> @@ -1699,9 +1699,13 @@
> void
> parse_eol(char *volatile *var)
> {
> - char *token = strtok(NULL, null_string);
> + unsigned char *token = strtok(NULL, null_string);
> safe_free(*var);
> if (token == NULL)
> self_destruct();
> + while(*token && isspace(*token))
> + token++;
> + if (!*token)
> + self_destruct();
> *var = xstrdup(token);
> }
>
> /Henrik
Received on Tue Jan 30 2001 - 03:13:09 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:13:26 MST