mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
kstrto*: accept "-0" for signed conversion
strtol(3) et al accept "-0", so should we. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: David Howells <dhowells@redhat.com> Cc: Jan Kara <jack@suse.cz> Cc: Joel Becker <jlbec@evilplan.org> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Theodore Ts'o <tytso@mit.edu> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
3cdea4d714
commit
2d2e4715a6
2 changed files with 2 additions and 6 deletions
|
@ -152,7 +152,7 @@ int kstrtoll(const char *s, unsigned int base, long long *res)
|
|||
rv = _kstrtoull(s + 1, base, &tmp);
|
||||
if (rv < 0)
|
||||
return rv;
|
||||
if ((long long)(-tmp) >= 0)
|
||||
if ((long long)-tmp > 0)
|
||||
return -ERANGE;
|
||||
*res = -tmp;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue