Module: monitoring-plugins
 Branch: master
 Commit: dab009654cfb76d690d7fb64ca9a190d855a308f
 Author: Lorenz Kästle <[email protected]>
   Date: Tue Sep 16 14:11:29 2025 +0200
    URL: 
https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=dab00965

fix default check state

---

 plugins/check_apt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/check_apt.c b/plugins/check_apt.c
index 80ce6060..9ed5b6cf 100644
--- a/plugins/check_apt.c
+++ b/plugins/check_apt.c
@@ -177,7 +177,7 @@ int main(int argc, char **argv) {
        mp_subcheck sc_other_updates = mp_subcheck_init();
 
        xasprintf(&sc_other_updates.output, "Updates available: %zu", 
packages_available);
-       mp_set_subcheck_default_state(sc_other_updates, STATE_OK);
+       sc_other_updates = mp_set_subcheck_default_state(sc_other_updates, 
STATE_OK);
        mp_add_perfdata_to_subcheck(&sc_other_updates, pd_other_updates);
 
        if (packages_available >= config.packages_warning && 
!config.only_critical) {

Reply via email to