diff options
author | Brian Norris <computersforpeace@gmail.com> | 2011-02-15 17:47:58 -0800 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-02-25 10:52:57 +0200 |
commit | 1b083e0c9011f32028a79d4ad707deaa17ad1b5e (patch) | |
tree | 9d371cd92000a6e439f60f9dc74f007d33e992eb /include | |
parent | 70f86090720d7b5b8203ee43356f8c6f79219896 (diff) |
mtd-utils: common.h: simple_strtoll type usage
We must use "long long" and "unsigned long long" types when
implementing the functions "simple_strtoll()" and "simple_strtoull()",
respectively. This prevents casting/truncation errors on systems where
"long" is not the same size as "long long" (that is, on most systems).
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/common.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/common.h b/include/common.h index eb8d5fc..2e5c2a0 100644 --- a/include/common.h +++ b/include/common.h @@ -108,9 +108,9 @@ static inline type simple_##func(const char *snum, int *error) \ return ret; \ } simple_strtoX(strtol, long int) -simple_strtoX(strtoll, long int) +simple_strtoX(strtoll, long long int) simple_strtoX(strtoul, unsigned long int) -simple_strtoX(strtoull, unsigned long int) +simple_strtoX(strtoull, unsigned long long int) #include "xalloc.h" |