lkml.org 
[lkml]   [2012]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] kstrto*: add documentation

On Thu, 12 Jul 2012, J. Bruce Fields wrote:
> On Fri, Jul 13, 2012 at 12:09:37AM +0200, Eldad Zack wrote:
> >
> > On Thu, 12 Jul 2012, J. Bruce Fields wrote:
> > 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).
>
> I believe it, but, in _kstrtoull:
>
> rv = _parse_integer(s, base, &_res);
> if (rv & KSTRTOX_OVERFLOW)
> return -ERANGE;
> rv &= ~KSTRTOX_OVERFLOW;
> if (rv == 0)
> return -EINVAL;
> s += rv;
> if (*s == '\n')
> s++;
> if (*s)
> return -EINVAL;
>
> So actually it appears the string must be all numeric except possibly a final
> newline.

Ah. You're right of course. Thanks! I also noticed I missed the SGML
templates, so I'll resend this at some point later.

Eldad


\
 
 \ /
  Last update: 2012-07-13 01:21    [W:0.064 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site