From e1ba7834c4d744557bd6ba808923398cf4b6dbba Mon Sep 17 00:00:00 2001 From: Gerard Wagener Date: Tue, 27 Nov 2018 17:24:45 +0100 Subject: [PATCH] added macro for inserting errors in the error stack --- client/d4.c | 2 ++ client/d4.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/client/d4.c b/client/d4.c index 55ab980..a9b607f 100644 --- a/client/d4.c +++ b/client/d4.c @@ -89,5 +89,7 @@ int main (int argc, char* argv[]) d4 = d4_init(confdir); free(confdir); d4_load_config(d4); + + return EXIT_SUCCESS; } diff --git a/client/d4.h b/client/d4.h index 384ed39..21913ae 100644 --- a/client/d4.h +++ b/client/d4.h @@ -6,6 +6,11 @@ #define SZCONFVALUE 1024 #define SZERRVALUE 1024 +#define INSERT_ERROR(...) do { \ + if (d4->err_idx < NERRORS) \ + snprintf(d4->errors[d4->err_idx],SZERRVALUE,__VA_ARGS__); \ + } while(0) + typedef struct d4_header_s { uint8_t version; uint8_t type;