diff options
Diffstat (limited to 'src/db/sqlite3/db.c')
-rw-r--r-- | src/db/sqlite3/db.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/db/sqlite3/db.c b/src/db/sqlite3/db.c index 796d924..f863028 100644 --- a/src/db/sqlite3/db.c +++ b/src/db/sqlite3/db.c @@ -171,14 +171,14 @@ int create_tables(const char *path) { // callback functions int group_count_callback(void *first_arg, int argc, char **argv, char **azColName) { Group **groups = (Group **) first_arg; - *groups = malloc(sizeof(Group) * argc); + *groups = malloc(sizeof(Group) * atoi(argv[0])); return 0; } int entry_count_callback(void *first_arg, int argc, char **argv, char **azColName) { Entry **entries = (Entry **) first_arg; - *entries = malloc(sizeof(Entry) * argc); + *entries = malloc(sizeof(Entry) * atoi(argv[0])); return 0; } |