added all the new error codes for the exits currently in the code
This commit is contained in:
12
src/main.c
12
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) {
|
int main(int argc, char **argv) {
|
||||||
printf("Hello from HardCompound!\n");
|
printf("\nHello from HardCompound!\n");
|
||||||
|
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
printf("You need to specify a duckdb file path! Terminating!\n");
|
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));
|
LapInfo *session_data = calloc(lap_count, sizeof(LapInfo));
|
||||||
double *lap_timestamps = calloc(lap_count, sizeof(double));
|
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;
|
duckdb_result lap_timestamps_res;
|
||||||
if (duckdb_query(conn, "Select ts as DOUBLE from Lap\n", &lap_timestamps_res) == DuckDBError) {
|
if (duckdb_query(conn, "Select ts as DOUBLE from Lap\n", &lap_timestamps_res) == DuckDBError) {
|
||||||
exit(ERR_QUERY);
|
exit(ERR_QUERY);
|
||||||
|
|||||||
Reference in New Issue
Block a user