Original -
x = simple_strtoul(" 20",NULL, 10);
x == 0 " 20" is disgarded
Patched -
x = simple_strtoul(" 20",NULL,10);
x == 20 " 20" is first trimmed to "20"
Sorry, I didn't feel 3 lines was diff worthy : >
unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base)
{
unsigned long result = 0,value;
+ while (*cp == ' ') {
+ cp++;
+ }
if (!base) {
base = 10;
if (*cp == '0') {