[sheepdog] [PATCH v1] dog/vdi: replace strtoll with strtoull

Bingpeng Zhu nkuzbp at foxmail.com
Sun Aug 31 08:20:03 CEST 2014


oid is of uint64_t type, VDI object oid is started with 0x80,
which is large than the maximum of long long int. So, we should
replace strtoll with strtoull in function vdi_parser().

Signed-off-by: Bingpeng Zhu <bingpeng.zbp at alibaba-inc.com>
---
 dog/vdi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dog/vdi.c b/dog/vdi.c
index 9230715..32b3e57 100644
--- a/dog/vdi.c
+++ b/dog/vdi.c
@@ -3021,7 +3021,7 @@ static int vdi_parser(int ch, const char *opt)
 		vdi_cmd_data.store_policy = 1;
 		break;
 	case 'o':
-		vdi_cmd_data.oid = strtoll(opt, &p, 16);
+		vdi_cmd_data.oid = strtoull(opt, &p, 16);
 		if (opt == p) {
 			sd_err("object id must be a hex integer");
 			exit(EXIT_FAILURE);
-- 
1.7.1






More information about the sheepdog mailing list