Skip to content

Commit

Permalink
fix sanitizer finding and limit/estimate evaluation logic broken in f…
Browse files Browse the repository at this point in the history
  • Loading branch information
vergoh committed Aug 19, 2024
1 parent 2eae9aa commit 4e495b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/dbshow.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/vnstat_func.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ void handleshowalert(PARAMS *p)
exit(EXIT_FAILURE);
}

if (alert >= 0 || alert <= 2) {
if (alert >= 0 && alert <= 2) {
exit(alert);
}

Expand Down

0 comments on commit 4e495b0

Please sign in to comment.