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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user