kobject sample code

Paul Bolle pebolle at tiscali.nl
Tue Dec 9 04:26:03 EST 2014


On Mon, 2014-12-08 at 21:20 -0500, John de la Garza wrote:
> I'm looking at samples/kobject/kobject-example.c
> 
> at line 39 foo is read:
> 
>         sscanf(buf, "%du", &foo);
> 
> foo is an int so why is it read using %du not %d?

My reading of lib/vsprintf.c:vsscanf() is that a "%du" format expects
"buf" to contain an integer followed by a literal 'u' char. Is that your
reading too?


Paul Bolle




More information about the Kernelnewbies mailing list