summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/db/sqlite3/db.c4
-rw-r--r--src/draw.c2
2 files changed, 2 insertions, 4 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;
}
diff --git a/src/draw.c b/src/draw.c
index 04e02e2..57e0021 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -24,8 +24,6 @@ void tui_init(Group **groups, Entry **entries) {
wrefresh(w_main);
// draw groups and entries
- fprintf(stderr, "groups: %d\n", sizeof(*groups) / sizeof(Group));
- fprintf(stderr, "entries: %d\n", sizeof(*entries) / sizeof(Entry));
input = getch();
tui_end();