diff options
author | Jett Rink <jettrink@chromium.org> | 2020-11-10 17:10:57 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-11 18:37:36 +0000 |
commit | e2dfdb09d970143b521a9c6f316ebe09159988ed (patch) | |
tree | 02fc659853834812b28387060aed74e0ad722bdb /common/util.c | |
parent | 737d4205a62c4b70ad33a6fbd547f5cb3f2b888c (diff) | |
download | chrome-ec-e2dfdb09d970143b521a9c6f316ebe09159988ed.tar.gz |
tree: rename strtoul to strtoull since it is 64-bit
A long is 32-bit, but a long long is 64-bit. The function name should be
strtoull if it is returning 64 bits of data.
BRANCH=none
BUG=b:172592963
TEST=builds
Signed-off-by: Jett Rink <jettrink@chromium.org>
Change-Id: I04c40f9256ed37eb1cf9b6bd1b0ef0320fe49b0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2530874
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'common/util.c')
-rw-r--r-- | common/util.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/common/util.c b/common/util.c index ed5b87c2c9..6188afc937 100644 --- a/common/util.c +++ b/common/util.c @@ -191,7 +191,8 @@ __stdlib_compat int strtoi(const char *nptr, char **endptr, int base) return neg ? -result : result; } -__stdlib_compat uint64_t strtoul(const char *nptr, char **endptr, int base) +__stdlib_compat unsigned long long int strtoull(const char *nptr, char **endptr, + int base) { uint64_t result = 0; int c = '\0'; @@ -226,6 +227,7 @@ __stdlib_compat uint64_t strtoul(const char *nptr, char **endptr, int base) *endptr = (char *)nptr - 1; return result; } +BUILD_ASSERT(sizeof(unsigned long long int) == sizeof(uint64_t)); __stdlib_compat int parse_bool(const char *s, int *dest) { |