aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Riehs <tristan.riehs@inria.fr>2025-11-16 10:34:14 +0100
committerTristan Riehs <tristan.riehs@inria.fr>2025-11-16 10:34:14 +0100
commit85b3cf1a9e26c98366c6b0b11316447f9afddf3e (patch)
tree4203838d59d3466f163cf17f7c55ab88d7c17f1f
parent112e72994f4423392769bc7a5fecee6ce9648010 (diff)
Fix table_next_id
-rw-r--r--src/main.c4
1 files changed, 2 insertions, 2 deletions
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;
}