summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/common-utils.c9
-rw-r--r--libglusterfs/src/gfdb/gfdb_sqlite3.c4
2 files changed, 8 insertions, 5 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index a9e74cb895a..cf5b524dc12 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -1581,11 +1581,12 @@ err:
}
int
-gf_string2bytesize_range (const char *str, uint64_t *n, uint64_t max)
+gf_string2bytesize_range (const char *str, uint64_t *n, uint64_t umax)
{
double value = 0.0;
- uint64_t int_value = 0;
+ int64_t int_value = 0;
uint64_t unit = 0;
+ int64_t max = 0;
char *tail = NULL;
int old_errno = 0;
const char *s = NULL;
@@ -1598,6 +1599,8 @@ gf_string2bytesize_range (const char *str, uint64_t *n, uint64_t max)
return -1;
}
+ max = umax & 0x7fffffffffffffffLL;
+
for (s = str; *s != '\0'; s++) {
if (isspace (*s))
continue;
@@ -2114,7 +2117,7 @@ get_nth_word (const char *str, int n)
if (!end)
goto out;
- word_len = abs (end - start);
+ word_len = labs (end - start);
word = GF_CALLOC (1, word_len + 1, gf_common_mt_strdup);
if (!word)
diff --git a/libglusterfs/src/gfdb/gfdb_sqlite3.c b/libglusterfs/src/gfdb/gfdb_sqlite3.c
index a2060fba7af..71d12db72c8 100644
--- a/libglusterfs/src/gfdb/gfdb_sqlite3.c
+++ b/libglusterfs/src/gfdb/gfdb_sqlite3.c
@@ -106,7 +106,7 @@ gf_sql_auto_vacuum_t
gf_sql_str2av_t (const char *av_str)
{
if (!av_str) {
- return gf_sql_sync_invalid;
+ return gf_sql_av_invalid;
} else if (strcmp (av_str, GF_SQL_AV_NONE) == 0) {
return gf_sql_av_none;
} else if (strcmp (av_str, GF_SQL_AV_FULL) == 0) {
@@ -114,7 +114,7 @@ gf_sql_str2av_t (const char *av_str)
} else if (strcmp (av_str, GF_SQL_AV_INCR) == 0) {
return gf_sql_av_incr;
}
- return gf_sql_sync_invalid;
+ return gf_sql_av_invalid;
}
const char *