From c3973f170773d6c25279bfe84654aef65ac84a67 Mon Sep 17 00:00:00 2001
From: Colin Ian King <colin.king@canonical.com>
Date: Thu, 21 Jul 2016 12:01:43 +0100
Subject: [PATCH 07/16] Initialise nprocs to zero to avoid printing garbage
 nprocs value
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

nprocs is not intialized, so we can call reg_scroll_show passing a
garbage value of nprocs from the stack.  Instead, initialize it to
zero so we don't have a random garbage value being emitted.

Fixes clang scan-build warning:

common/win.c:3403:2: warning: Function call argument is an uninitialized value
        reg_scroll_show(data_reg, (void *)lines, nprocs,

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 common/win.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/win.c b/common/win.c
index 21f8737..7daa320 100644
--- a/common/win.c
+++ b/common/win.c
@@ -3327,7 +3327,7 @@ pqos_mbm_data_show(dyn_win_t *win, boolean_t *note_out)
 	dyn_pqos_mbm_proc_t *dyn;
 	win_reg_t *r, *data_reg;
 	char content[WIN_LINECHAR_MAX], intval_buf[16];
-	int nprocs;
+	int nprocs = 0;
 	track_proc_t *proc = NULL;
 	track_lwp_t *lwp = NULL;
 	int intval;
-- 
2.10.2

