openocd: remove NULL comparisons with checkpatch [1/2]
Patch generated automatically through the new checkpatch with flags "--types COMPARISON_TO_NULL --fix-inplace". This only fixes the comparisons if (symbol == NULL) if (symbol != NULL) The case of NULL on the left side of the comparison is not tested. Some automatic fix is incorrect and has been massaged by hands: - if (*psig == NULL) + if (*!psig) changed as + if (!*psig) Change-Id: If4a1e2b4e547e223532e8e3d9da89bf9cb382ce6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6351 Tested-by: jenkins
This commit is contained in:
@@ -199,7 +199,7 @@ static void telnet_save_history(struct telnet_connection *t_con)
|
||||
i = t_con->current_history + 1;
|
||||
i %= TELNET_LINE_HISTORY_SIZE;
|
||||
|
||||
while (t_con->history[i] == NULL && num > 0) {
|
||||
while (!t_con->history[i] && num > 0) {
|
||||
i++;
|
||||
i %= TELNET_LINE_HISTORY_SIZE;
|
||||
num--;
|
||||
@@ -640,7 +640,7 @@ static int telnet_input(struct connection *connection)
|
||||
/* save only non-blank not repeating lines in the history */
|
||||
char *prev_line = t_con->history[(t_con->current_history > 0) ?
|
||||
t_con->current_history - 1 : TELNET_LINE_HISTORY_SIZE-1];
|
||||
if (*t_con->line && (prev_line == NULL ||
|
||||
if (*t_con->line && (!prev_line ||
|
||||
strcmp(t_con->line, prev_line))) {
|
||||
/* if the history slot is already taken, free it */
|
||||
free(t_con->history[t_con->next_history]);
|
||||
|
||||
Reference in New Issue
Block a user