Przeglądaj źródła

dselect: Assign desc->desc instead of checking if desc is not nullptr

If we've not found any description we end up in the sentinel entry that
contains nullptr for desc->action and desc->desc, but definitely not
nullptr for desc. Just assigning desc->desc will do the right thing.

Warned-by: coverity
Guillem Jover 12 lat temu
rodzic
commit
00e3728ddb
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      dselect/bindings.cc

+ 1 - 1
dselect/bindings.cc

@@ -66,7 +66,7 @@ keybindings::bind(int key, const char *action)
     bindings = b;
     bindings = b;
   }
   }
   b->interp = interp;
   b->interp = interp;
-  b->desc = desc ? desc->desc : nullptr;
+  b->desc = desc->desc;
 
 
   return true;
   return true;
 }
 }