[PATCH][BZ #15346] Allow leading and trailing spaces in getdate

Roland McGrath roland@hack.frob.com
Mon Apr 8 21:53:00 GMT 2013


> +  /* Skip leading spaces.  */

s/spaces/whitespace/

> +  while (string[i] && isspace (string[i]))
> +    i++;

Avoid Boolean coercion: string[i] != '\0'.
But since you've already done strlen, why not i < inlen?

> +  /* Skip trailing spaces.  */

s/spaces/whitespace/

> +  char *instr;
> +  if (__libc_use_alloca (inlen + 1))
> +    {
> +      instr = alloca (inlen + 1);
> +    }

Drop the braces here.



More information about the Libc-alpha mailing list