aboutsummaryrefslogtreecommitdiff
path: root/src/helper/fileio.c
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2021-07-03 22:10:55 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2021-07-24 10:38:19 +0100
commit54e699b2601036e384a124657aa1fbdd9ff2dc87 (patch)
tree69bb8d7842b6a8eb23d005fc51a1f414038d99a0 /src/helper/fileio.c
parent0a1f904707fa3c170032dd9dba8f2ef9207ff9b2 (diff)
downloadriscv-openocd-54e699b2601036e384a124657aa1fbdd9ff2dc87.zip
riscv-openocd-54e699b2601036e384a124657aa1fbdd9ff2dc87.tar.gz
riscv-openocd-54e699b2601036e384a124657aa1fbdd9ff2dc87.tar.bz2
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
Diffstat (limited to 'src/helper/fileio.c')
-rw-r--r--src/helper/fileio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/helper/fileio.c b/src/helper/fileio.c
index d544b85..cec7dec 100644
--- a/src/helper/fileio.c
+++ b/src/helper/fileio.c
@@ -208,7 +208,7 @@ int fileio_read_u32(struct fileio *fileio, uint32_t *data)
static int fileio_local_fgets(struct fileio *fileio, size_t size, void *buffer)
{
- if (fgets(buffer, size, fileio->file) == NULL)
+ if (!fgets(buffer, size, fileio->file))
return ERROR_FILEIO_OPERATION_FAILED;
return ERROR_OK;