From 0e5e8ca9e67dbd9e8cd943db343564d26ca7e398 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 27 Feb 2015 16:01:45 +0100 Subject: [PATCH] Utils: Include stdint.h and fix signess in sdigits10(). --- src/util.c | 2 +- src/util.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index 4b1aaaba..295f3264 100644 --- a/src/util.c +++ b/src/util.c @@ -256,7 +256,7 @@ uint32_t sdigits10(int64_t v) { if (v < 0) { /* Abs value of LLONG_MIN requires special handling. */ uint64_t uv = (v != LLONG_MIN) ? - -v : ((uint64_t) LLONG_MAX)+1; + (uint64_t)-v : ((uint64_t) LLONG_MAX)+1; return digits10(uv)+1; /* +1 for the minus. */ } else { return digits10(v); diff --git a/src/util.h b/src/util.h index 544b9b8b..c27f7017 100644 --- a/src/util.h +++ b/src/util.h @@ -30,6 +30,7 @@ #ifndef __REDIS_UTIL_H #define __REDIS_UTIL_H +#include #include "sds.h" int stringmatchlen(const char *p, int plen, const char *s, int slen, int nocase);