lists.openwall.net   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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPXGRDkgEKFU7fVDqz33C9vqjdxmBYTbPEPbcfhpkg0NxOJz-g@mail.gmail.com>
Date:	Mon, 7 May 2012 04:20:18 +0200
From:	Pierre Carrier <pierre@...tify.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Stephen Rothwell <sfr@...b.auug.org.au>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] lib/vsprintf.c: "%#o",0 becomes '0' instead of '00'

On Mon, May 7, 2012 at 3:59 AM, Joe Perches <joe@...ches.com> wrote:
> If you do this, why not change 0-7 instead of just 0?

Consistency with POSIX *printf.

"#: Specifies that the value is to be converted to an alternative
form. For o conversion, it increases the precision (if necessary) to
force the first digit of the result to be zero."
-- http://pubs.opengroup.org/onlinepubs/009695399/functions/printf.html

% cat octal.c;gcc -o octal octal.c;./octal
#include <stdio.h>
void main() {
        int i;
        for (i=0;i<10;i++) printf("%#o ", i);
        puts("");
}
0 01 02 03 04 05 06 07 010 011

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ