Ticket #3693: mc-3693-dialogs.c-Cleanup-maybe-uninitialized-compiler-warni.patch

File mc-3693-dialogs.c-Cleanup-maybe-uninitialized-compiler-warni.patch, 973 bytes (added by and, 5 years ago)
  • src/viewer/dialogs.c

    From 3ba19d19a8aa417231f667d61326dcbbaeab196c Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Tue, 6 Dec 2016 10:17:57 +0000
    Subject: [PATCH] (dialogs.c) Cleanup maybe-uninitialized compiler warning
    
    Found by GCC 6.2.0.
    
    dialogs.c: In function 'mcview_dialog_search':
    dialogs.c:87:24: error: 'num_of_types' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    dialogs.c:81:12: note: 'num_of_types' was declared here
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/viewer/dialogs.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/viewer/dialogs.c b/src/viewer/dialogs.c
    index 844b9ae..7560977 100644
    a b mcview_dialog_search (WView * view) 
    7878{ 
    7979    char *exp = NULL; 
    8080    int qd_result; 
    81     size_t num_of_types; 
     81    size_t num_of_types = 0; 
    8282    gchar **list_of_types; 
    8383 
    8484    list_of_types = mc_search_get_types_strings_array (&num_of_types);