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:
Antonio Borneo
2021-07-03 22:10:55 +02:00
parent 0a1f904707
commit 54e699b260
10 changed files with 23 additions and 32 deletions

View File

@@ -2218,7 +2218,7 @@ static int aice_execute_custom_script(const char *script)
if (!script_fd) {
return ERROR_FAIL;
} else {
while (fgets(line_buffer, LINE_BUFFER_SIZE, script_fd) != NULL) {
while (fgets(line_buffer, LINE_BUFFER_SIZE, script_fd)) {
/* execute operations */
set_op = false;
op_str = strstr(line_buffer, "set");