From 8747c5ef8a4cb7d0d08175f047a222eb15ded033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20K=C3=A4stle?= Date: Mon, 18 May 2026 11:12:56 +0200 Subject: [PATCH] check_load: show the correct amount of procs --- plugins/check_load.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/check_load.c b/plugins/check_load.c index 46b4ed1a..de13f7b8 100644 --- a/plugins/check_load.c +++ b/plugins/check_load.c @@ -253,7 +253,8 @@ int main(int argc, char **argv) { config.n_procs_to_show); if (top_proc.errorcode == OK) { - for (unsigned long i = 0; i < config.n_procs_to_show; i++) { + // +1 here since the string list contains the header line + for (unsigned long i = 0; i < config.n_procs_to_show +1; i++) { xasprintf(&top_proc_sc.output, "%s\n%s", top_proc_sc.output, top_proc.top_processes[i]); }