lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 29 Dec 2012 19:07:48 -0800
From:	Joe Perches <>
To:	Roland Dreier <>,
	Peter Zijlstra <>,
	Paul Mackerras <>,
	Ingo Molnar <>,
	Arnaldo Carvalho de Melo <>
Cc:	Greg Kroah-Hartman <>,
	Sylvain Munaut <>,
	Kay Sievers <>,
	Andrew Morton <>,
	LKML <>
Subject: Re: [PATCH] printk: Fix incorrect length from print_time() when
 seconds > 99999

On Sat, 2012-12-29 at 14:27 -0800, Roland Dreier wrote:
> On Sat, Dec 29, 2012 at 12:08 PM, Joe Perches <> wrote:
> > Sylvan Munaut did something similar
> >
> Missed that and duplicated the debugging :(
> Sorry Sylvain.
> I guess my patch may be preferable, since I happened to use the snprintf()
> method that you suggest -- all the open-coded digit-counting seems a bit
> verbose and perhaps hard to read and see the equivalence to the sprintf.

the kernel implementation of snprint/vsnprintf does expand on c99
and allow snprintf(NULL, 0... so your code should work fine.

I think the
	snprintf(NULL, 0
might be suspect.
(the same form is already used in drivers/usb/gadget/composite.c)

man snprintf says in part:

       Concerning the return value of snprintf(),  SUSv2  and  C99  contradict
       each other: when snprintf() is called with size=0 then SUSv2 stipulates
       an unspecified return value less than 1, while C99  allows  str  to  be
       NULL in this case, and gives the return value (as always) as the number
       of characters that would have been written in case  the  output  string
       has been large enough.

If not here, maybe the tools/perf/util/values.c code
that uses the same form might need changing.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists