diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2015-09-10 00:36:17 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-10 22:29:01 +0200 |
commit | 2d2e4715a65ca7e81b292d01ae009a03ccedb9b5 (patch) | |
tree | 540fd65bc0d6d914dd8c5074d63074d3dc8d4f23 /lib/kstrtox.c | |
parent | MAINTAINERS/CREDITS: mark MaxRAID as Orphan, move Anil Ravindranath to CREDITS (diff) | |
download | linux-2d2e4715a65ca7e81b292d01ae009a03ccedb9b5.tar.xz linux-2d2e4715a65ca7e81b292d01ae009a03ccedb9b5.zip |
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>
Diffstat (limited to 'lib/kstrtox.c')
-rw-r--r-- | lib/kstrtox.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/kstrtox.c b/lib/kstrtox.c index ec8da78df9be..94be244e8441 100644 --- a/lib/kstrtox.c +++ b/lib/kstrtox.c @@ -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 { |