From 85b3cf1a9e26c98366c6b0b11316447f9afddf3e Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Sun, 16 Nov 2025 10:34:14 +0100 Subject: Fix table_next_id --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index c15d98e..0472920 100644 --- a/src/main.c +++ b/src/main.c @@ -76,7 +76,7 @@ static void assert_no_single_quote(const char *str) assert(strchr(str, ';') == NULL); } -/* Write an id to *_ID, used by table_next_id. Write 0 if no id is found. */ +/* Write an id to *_ID, used by table_next_id. Write -1 if no id is found. */ static int table_next_id_callback(void *_id, int, char **cols, char **) { /* output has only one column, so our id is in COLS[0] */ @@ -84,7 +84,7 @@ static int table_next_id_callback(void *_id, int, char **cols, char **) if (cols[0]) *id = atoi(cols[0]); else - *id = 0; + *id = -1; return 0; } -- cgit v1.2.3