From 53a2194bde4d65c92c66f870fe8073f2510eb807 Mon Sep 17 00:00:00 2001 From: htom Date: Thu, 8 Jan 2026 12:53:49 +0100 Subject: [PATCH] added all the new error codes for the exits currently in the code --- src/main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index ecaf8ae..e82be1f 100644 --- a/src/main.c +++ b/src/main.c @@ -80,7 +80,7 @@ void get_data_from_db(const char *query, duckdb_connection *conn, TelemetryInfo } int main(int argc, char **argv) { - printf("Hello from HardCompound!\n"); + printf("\nHello from HardCompound!\n"); if (argc < 2) { printf("You need to specify a duckdb file path! Terminating!\n"); @@ -139,6 +139,16 @@ int main(int argc, char **argv) { LapInfo *session_data = calloc(lap_count, sizeof(LapInfo)); double *lap_timestamps = calloc(lap_count, sizeof(double)); + if (!session_data) { + printf("Session data failed to allocate!"); + exit(ERR_MEMORY); + } + + if (!lap_timestamps) { + printf("Lap timestaps array failed to init!"); + exit(ERR_MEMORY); + } + duckdb_result lap_timestamps_res; if (duckdb_query(conn, "Select ts as DOUBLE from Lap\n", &lap_timestamps_res) == DuckDBError) { exit(ERR_QUERY);