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); }