From: Brian Norris Date: Wed, 16 Feb 2011 01:47:58 +0000 (-0800) Subject: mtd-utils: common.h: simple_strtoll type usage X-Git-Tag: v1.4.3~3 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1b083e0c9011f32028a79d4ad707deaa17ad1b5e;p=mtd-utils.git 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 Acked-by: Mike Frysinger Signed-off-by: Artem Bityutskiy --- 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"