Re: kobject sample code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 09, 2014 at 10:26:03AM +0100, Paul Bolle wrote:
> 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?
> 
After reading the code and the man page for vsscanf, it seems like
it is not expecting the 'u', but rather ignores it.

vsscanf is a bit complicated for me, so I may be missing something.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux