Ticket #3955: mc-3955-setup.c-cleanup-cppcheck-warning.patch

File mc-3955-setup.c-cleanup-cppcheck-warning.patch, 970 bytes (added by and, 6 years ago)
  • src/setup.c

    From 765b12cfaaf1c8e3c213030a2a16ab8a9cd8fd2d Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Tue, 8 Jan 2019 06:55:21 +0000
    Subject: [PATCH] setup.c: Cleanup cppcheck style warning
    
    Found by cppcheck 1.81
    
    [src/setup.c:1079]: (style) The scope of the variable 'buffer' can be reduced.
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/setup.c | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/src/setup.c b/src/setup.c
    index dec1accbd..04f770ee9 100644
    a b load_setup (void) 
    10761076    const char *profile; 
    10771077 
    10781078#ifdef HAVE_CHARSET 
    1079     char *buffer; 
    10801079    const char *cbuffer; 
    10811080 
    10821081    load_codepages_list (); 
    load_setup (void) 
    11381137#ifdef HAVE_CHARSET 
    11391138    if (codepages->len > 1) 
    11401139    { 
     1140        char *buffer; 
     1141 
    11411142        buffer = 
    11421143            mc_config_get_string (mc_global.main_config, CONFIG_MISC_SECTION, "display_codepage", 
    11431144                                  "");