diff options
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/store.c | 6 | ||||
-rw-r--r-- | libglusterfs/src/store.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/libglusterfs/src/store.c b/libglusterfs/src/store.c index daa57101a46..b44ee0a12d6 100644 --- a/libglusterfs/src/store.c +++ b/libglusterfs/src/store.c @@ -176,7 +176,7 @@ out: } int -gf_store_read_and_tokenize (FILE *file, char *str, char **iter_key, +gf_store_read_and_tokenize (FILE *file, char *str, int size, char **iter_key, char **iter_val, gf_store_op_errno_t *store_errno) { int32_t ret = -1; @@ -192,7 +192,7 @@ gf_store_read_and_tokenize (FILE *file, char *str, char **iter_key, GF_ASSERT (iter_val); GF_ASSERT (store_errno); - temp = fgets (str, PATH_MAX, file); + temp = fgets (str, size, file); if (temp == NULL || feof (file)) { ret = -1; *store_errno = GD_STORE_EOF; @@ -287,6 +287,7 @@ gf_store_retrieve_value (gf_store_handle_t *handle, char *key, char **value) do { ret = gf_store_read_and_tokenize (handle->read, scan_str, + st.st_size + 1, &iter_key, &iter_val, &store_errno); if (ret < 0) { @@ -569,6 +570,7 @@ gf_store_iter_get_next (gf_store_iter_t *iter, char **key, char **value, } ret = gf_store_read_and_tokenize (iter->file, scan_str, + st.st_size + 1, &iter_key, &iter_val, &store_errno); if (ret < 0) { diff --git a/libglusterfs/src/store.h b/libglusterfs/src/store.h index 4a726c6f00b..7ac307bf5ae 100644 --- a/libglusterfs/src/store.h +++ b/libglusterfs/src/store.h @@ -59,7 +59,7 @@ int32_t gf_store_unlink_tmppath (gf_store_handle_t *shandle); int -gf_store_read_and_tokenize (FILE *file, char *str, char **iter_key, +gf_store_read_and_tokenize (FILE *file, char *str, int size, char **iter_key, char **iter_val, gf_store_op_errno_t *store_errno); int32_t |