summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/common-utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index 63d7f6e3530..146384fe94d 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -1257,7 +1257,7 @@ err:
int
gf_string2bytesize (const char *str, uint64_t *n)
{
- uint64_t value = 0ULL;
+ double value = 0.0;
char *tail = NULL;
int old_errno = 0;
const char *s = NULL;
@@ -1278,7 +1278,7 @@ gf_string2bytesize (const char *str, uint64_t *n)
old_errno = errno;
errno = 0;
- value = strtoull (str, &tail, 10);
+ value = strtod (str, &tail);
if (errno == ERANGE || errno == EINVAL)
return -1;
@@ -1302,7 +1302,7 @@ gf_string2bytesize (const char *str, uint64_t *n)
return -1;
}
- *n = value;
+ *n = (uint64_t) value;
return 0;
}