From 4e495b055ac645656c942475eaf2b39041f6f218 Mon Sep 17 00:00:00 2001 From: Teemu Toivola Date: Mon, 19 Aug 2024 23:11:37 +0300 Subject: [PATCH] fix sanitizer finding and limit/estimate evaluation logic broken in faf76f3 --- src/dbshow.c | 4 +++- src/vnstat_func.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dbshow.c b/src/dbshow.c index b1bd11e..7c25dc8 100644 --- a/src/dbshow.c +++ b/src/dbshow.c @@ -1129,7 +1129,9 @@ int showalert(const char *interface, const AlertOutput output, const AlertExit a } else if (aexit == AE_Exit_2_On_Limit) { ret = 2; } - } else if (adata.estimateexceeded) { + } + + if (adata.estimateexceeded) { if (aexit == AE_Exit_1_On_Estimate) { ret = 1; } else if (aexit == AE_Exit_2_On_Estimate) { diff --git a/src/vnstat_func.c b/src/vnstat_func.c index 9e5d8fe..5691ce8 100644 --- a/src/vnstat_func.c +++ b/src/vnstat_func.c @@ -912,7 +912,7 @@ void handleshowalert(PARAMS *p) exit(EXIT_FAILURE); } - if (alert >= 0 || alert <= 2) { + if (alert >= 0 && alert <= 2) { exit(alert); }