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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 13 Jul 2012 00:09:37 +0200 (CEST)
From:	Eldad Zack <eldad@...refinery.com>
To:	"J. Bruce Fields" <bfields@...ldses.org>
cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Joe Perches <joe@...ches.com>,
	open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] kstrto*: add documentation


On Thu, 12 Jul 2012, J. Bruce Fields wrote:
> On Thu, Jul 12, 2012 at 10:53:13PM +0200, Eldad Zack wrote:
> > +/**
> > + * kstrtoul - convert a string to an unsigned long
> 
> Also, is it worth mentioning that the number is required to be followed
> by a string or newline?

I am not sure if I understand _parse_integer correctly (which is called 
to do the actual parsing and has a very nice comment to it) - but it 
expects a null-terminated string, but will also stop as soon as it 
bumps into any other non-number character without error (please correct 
me I'm wrong).
In that case maybe "This function stops parsing as soon as it gets to a 
character which doesn't belong to the given base, including newline 
or null.".

And now that I read it more closely, how about:
"If base is given as 0, then the base of the string is automatically
detected with the conventional semantics: If the string begins with 0x
the number will be parsed as a hexadecimel (case insensitive). If
it otherwise begins with 0, it will be parsed as an octal number.
Otherwise it will be parsed as a decimal."

Eldad

--
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