Ticket #3955: mc-3955-panel.c-cleanup-potential-conditional-uninitialized-warning.patch

File mc-3955-panel.c-cleanup-potential-conditional-uninitialized-warning.patch, 1.2 KB (added by and, 6 years ago)
  • src/filemanager/panel.c

    From 19d1974b02a44b3a0f3910cad4cda8ccd16f71ba Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sat, 5 Jan 2019 15:24:56 +0000
    Subject: [PATCH] panel.c: cleanup potential conditional uninitialized warning
    
    Found by Clang 6.0.1
    
    panel.c:1751:23: error: variable 'klen' may be uninitialized when used here [-Werror,-Wconditional-uninitialized]
                format += klen;
                          ^~~~
    panel.c:1715:20: note: initialize the variable 'klen' to silence this warning
            size_t klen;
                       ^
                        = 0
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/filemanager/panel.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c
    index 1662d9e3a..64e880eef 100644
    a b parse_display_format (WPanel * panel, const char *format, char **error, gboolean 
    17121712        align_crt_t justify;    /* Which mode. */ 
    17131713        gboolean set_justify = TRUE;    /* flag: set justification mode? */ 
    17141714        gboolean found = FALSE; 
    1715         size_t klen; 
     1715        size_t klen = 0; 
    17161716 
    17171717        darr = g_new0 (format_item_t, 1); 
    17181718        home = g_slist_append (home, darr);