From 50c641aab7c4400393b7d2ab6be9267e3fa1eac7 Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Tue, 3 Jun 2014 16:46:03 +0200 Subject: [PATCH] fix a potential use of uninitialized variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit show.c: In function ‘show_dev_detail’: show.c:214:11: warning: ‘c’ may be used uninitialized in this function [-Wmaybe-uninitialized] char *s, c; ^ --- show.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/show.c b/show.c index bece7e6..4cdf704 100644 --- a/show.c +++ b/show.c @@ -316,8 +316,12 @@ void show_dev_detail(void) case SR_TRIGGER_UNDER: c = 'u'; break; + default: + c = 0; + break; } - printf("%c ", c); + if (c) + printf("%c ", c); } printf("\n"); g_variant_unref(gvar_list); -- 2.30.2