Re: why does sscanf() does not interpret number length attributes?

Stephen Wille Padnos (spadnos@sover.net)
Wed, 02 Jul 2003 19:00:32 -0400


Kay Sievers wrote:

[snip]

>but sscanf in linux-2.5/lib/vsprintf.c interpretes length attributes
>only when the type is a string. It uses simple_strtoul() and it will
>read the buffer until it finds a non-(hex)digit.
>
>
[snip]
You could always try truncating the string, then using strtoul(). Save
the character you replace if you want to restore the string to its
former glory :)

eg.:
...
savechar = str[3];
str[3]=0;
i = simple_strtoul(str);
str[3]=savechar;
...
- Steve

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/