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

File mc-3955-file.c-cleanup-cppcheck-warning.patch, 1.6 KB (added by and, 7 weeks ago)
  • src/filemanager/file.c

    From f9f7e7c924a4b93dc480eab43a2138184dff4593 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Tue, 8 Jan 2019 06:39:09 +0000
    Subject: [PATCH] file.c: Cleanup cppcheck suspicious condition warning
    
    Found by cppcheck 1.81
    
    [src/filemanager/file.c:386]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.
    [src/filemanager/file.c:406]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/filemanager/file.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/src/filemanager/file.c b/src/filemanager/file.c
    index 01054bf0b..e9d377630 100644
    a b check_hardlinks (const vfs_path_t * src_vpath, const struct stat *src_stat, 
    383383                { 
    384384                    gboolean ok; 
    385385 
    386                     while (!(ok = mc_stat (lnk->dst_vpath, &link_stat) == 0) && !*skip_all) 
     386                    while (!(ok = (mc_stat (lnk->dst_vpath, &link_stat) == 0)) && !*skip_all) 
    387387                    { 
    388388                        FileProgressStatus status; 
    389389 
    check_hardlinks (const vfs_path_t * src_vpath, const struct stat *src_stat, 
    403403                    if (!ok) 
    404404                        return HARDLINK_ERROR; 
    405405 
    406                     while (!(ok = mc_link (lnk->dst_vpath, dst_vpath) == 0) && !*skip_all) 
     406                    while (!(ok = (mc_link (lnk->dst_vpath, dst_vpath) == 0)) && !*skip_all) 
    407407                    { 
    408408                        FileProgressStatus status; 
    409409