Fix the following warning:

edid-decode.c: In function ‘parse_cta’:
edid-decode.c:142:5: warning: ‘v’ may be used uninitialized in this function 
[-Wmaybe-uninitialized]

Signed-off-by: Baruch Siach <bar...@tkos.co.il>
---
 edid-decode.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/edid-decode.c b/edid-decode.c
index 5592227d1db5..3df35ec6d07f 100644
--- a/edid-decode.c
+++ b/edid-decode.c
@@ -124,7 +124,7 @@ struct field {
 static void
 decode_value(struct field *field, int val, const char *prefix)
 {
-    struct value *v;
+    struct value *v = NULL;
     int i;
 
     for (i = 0; i < field->n_values; i++) {
@@ -139,7 +139,8 @@ decode_value(struct field *field, int val, const char 
*prefix)
        return;
     }
 
-    printf("%s%s: %s (%d)\n", prefix, field->name, v->description, val);
+    printf("%s%s: %s (%d)\n", prefix, field->name,
+         v ? v->description : "unknown", val);
 }
 
 static void
-- 
2.14.1

Reply via email to