summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 79ba885)
raw | patch | inline | side by side (parent: 79ba885)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 8 Mar 2015 21:47:51 +0000 (22:47 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 8 Mar 2015 21:47:51 +0000 (22:47 +0100) |
Else, we'd have an endless loop as the caller doesn't know about that.
src/core/store_expr.c | patch | blob | history |
diff --git a/src/core/store_expr.c b/src/core/store_expr.c
index 42ebcaa26954a42ab279fbd20728c98f591e8e35..11370bb438455f6fcf3b08a34a4bcfa5607a98af 100644 (file)
--- a/src/core/store_expr.c
+++ b/src/core/store_expr.c
{
sdb_data_t null = SDB_DATA_INIT;
sdb_data_t ret = SDB_DATA_INIT;
+ sdb_data_t tmp = SDB_DATA_INIT;
if (! iter)
return null;
if (iter->array_idx >= iter->array.data.array.length)
return null;
- if (sdb_data_array_get(&iter->array, iter->array_idx, &ret))
- return null;
++iter->array_idx;
+ if (sdb_data_array_get(&iter->array, iter->array_idx - 1, &ret))
+ return null;
+ if (sdb_data_copy(&tmp, &ret))
+ return null;
+ ret = tmp;
return ret;
} /* sdb_store_expr_iter_get_next */