]> sigrok.org Git - sigrok-cli.git/commitdiff
fix a potential use of uninitialized variable
authorAurelien Jacobs <redacted>
Tue, 3 Jun 2014 14:46:03 +0000 (16:46 +0200)
committerBert Vermeulen <redacted>
Tue, 3 Jun 2014 17:00:17 +0000 (19:00 +0200)
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

diff --git a/show.c b/show.c
index bece7e641b957ea94bd2bb4ad9d1a538780660ad..4cdf7049da05e51809ba1f4277560fac5b33b55d 100644 (file)
--- 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);