[sheepdog] [PATCH] sheep/oc: use strtoull instead of strtoul

Ruoyu liangry at ucweb.com
Mon Sep 1 04:53:41 CEST 2014


Although long long data type is the same as long data type in 64-bit
platform, it is better to use only one of them. Since we use strtoull
in other place of the module, we should not use strtoul.

Signed-off-by: Ruoyu <liangry at ucweb.com>
---
 sheep/object_cache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sheep/object_cache.c b/sheep/object_cache.c
index edfac6d..0d115b4 100644
--- a/sheep/object_cache.c
+++ b/sheep/object_cache.c
@@ -1277,8 +1277,8 @@ static int load_cache(void)
 	while ((d = readdir(dir))) {
 		if (!strncmp(d->d_name, ".", 1))
 			continue;
-		vid = strtoul(d->d_name, NULL, 16);
-		if (vid == ULONG_MAX)
+		vid = strtoull(d->d_name, NULL, 16);
+		if (vid == ULLONG_MAX)
 			continue;
 
 		load_cache_object(find_object_cache(vid, true));
-- 
1.8.3.2





More information about the sheepdog mailing list