Ticket #4179: mc-4179-editsearch.c-fix-deadcode.deadstores-warning.patch

File mc-4179-editsearch.c-fix-deadcode.deadstores-warning.patch, 1.0 KB (added by and, 12 months ago)
  • src/editor/editsearch.c

    From bedaf035147edacfbbf6b4fcc4bbbf6cef7a9ace Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Mon, 24 May 2021 15:42:37 +0000
    Subject: [PATCH] (editsearch.c) fix deadcode.DeadStores warning
    
    editsearch.c:915:13: warning: Value stored to 'i' is never read [deadcode.DeadStores]
                i = edit->found_len = len;
                ^   ~~~~~~~~~~~~~~~~~~~~~
    
    Found by Clang-11 analyzer
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/editor/editsearch.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/editor/editsearch.c b/src/editor/editsearch.c
    index 329ce009a..7ea57f744 100644
    a b edit_replace_cmd (WEdit * edit, gboolean again) 
    912912            GString *repl_str; 
    913913 
    914914            edit->found_start = edit->search_start; 
    915             i = edit->found_len = len; 
     915            edit->found_len = len; 
    916916 
    917917            edit_cursor_move (edit, edit->search_start - edit->buffer.curs1); 
    918918            edit_scroll_screen_over_cursor (edit);