openocd: manually remove NULL comparisons
For the remaining NULL comparisons, remove then manually. While there, make more readable a loop, by moving the assigment out of the loop condition. Change-Id: I44193aaa95813156a3a79c16b80e1ad333dc1eaf Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6353 Tested-by: jenkins
This commit is contained in:
@@ -815,9 +815,9 @@ static COMMAND_HELPER(command_help_show, struct help_entry *c,
|
||||
|
||||
/* If the match string occurs anywhere, we print out
|
||||
* stuff for this command. */
|
||||
bool is_match = (strstr(c->cmd_name, cmd_match) != NULL) ||
|
||||
((c->usage) && (strstr(c->usage, cmd_match) != NULL)) ||
|
||||
((c->help) && (strstr(c->help, cmd_match) != NULL));
|
||||
bool is_match = strstr(c->cmd_name, cmd_match) ||
|
||||
(c->usage && strstr(c->usage, cmd_match)) ||
|
||||
(c->help && strstr(c->help, cmd_match));
|
||||
|
||||
if (is_match) {
|
||||
if (c->usage && strlen(c->usage) > 0) {
|
||||
|
||||
Reference in New Issue
Block a user