Просмотр исходного кода

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
Родитель
Сommit
00e3728ddb
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      dselect/bindings.cc

+ 1 - 1
dselect/bindings.cc

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