On Wednesday 23 November 2011 04:51:45 Robert Deliën wrote:
> +       if (name[0] >= '0' && name[0] <= '9') {
> +               pin_nr = simple_strtoul(name, (char **)&name, 10);
> +               if (name[0])
> +                       return -EINVAL;
> 
> Why do we need this check ? We have already copied / converted the
> number in pin_nr, we do not need to check in the string again. And you
> do not need to update name, because you are returning in any case.
> 
> This check checks if name pointer - after it's updated by simple_strtoul -
> points to the terminating NULL character. If if does, name contained a
> valid number. If it doesn't, it's pointing to trailing garbage and hence
> name didn't contain a valid number. In other words; This checks prevents a
> string like 3kjh;khji being interpreted as 3.

your client apparently lacks proper quoting.  please do something about this.  
it's fairly difficult to figure out what you're saying and what you're quoting.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to