Ticket #3607: mc-3607-cleanup-cppcheck-warning-at-utilunix.patch

File mc-3607-cleanup-cppcheck-warning-at-utilunix.patch, 1.1 KB (added by and, 9 years ago)
  • lib/utilunix.c

    From 9c0b5e89ce10e6ccfb57a355a4f4481d3655804b Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sun, 24 Apr 2016 17:43:38 +0000
    Subject: [PATCH] Cleanup cppcheck warning at utilunix.c
    
    Cleanup following cppcheck warnings:
    
    [lib/utilunix.c:1109]: (style) Unused variable: link_path
    [lib/utilunix.c:1113]: (style) Variable 'readlinks' is assigned a value that is never used.
    [lib/utilunix.c:1114]: (style) Unused variable: n
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     lib/utilunix.c | 4 +++-
     1 file changed, 3 insertions(+), 1 deletion(-)
    
    diff --git a/lib/utilunix.c b/lib/utilunix.c
    index fef7a64..8192923 100644
    a b char * 
    11061106mc_realpath (const char *path, char *resolved_path) 
    11071107{ 
    11081108    char copy_path[PATH_MAX]; 
    1109     char link_path[PATH_MAX]; 
    11101109    char got_path[PATH_MAX]; 
    11111110    char *new_path = got_path; 
    11121111    char *max_path; 
     1112#ifdef S_IFLNK 
     1113    char link_path[PATH_MAX]; 
    11131114    int readlinks = 0; 
    11141115    int n; 
     1116#endif /* S_IFLNK */ 
    11151117 
    11161118    /* Make a copy of the source path since we may need to modify it. */ 
    11171119    if (strlen (path) >= PATH_MAX - 2)