From 70a2e91f1cb41a09d9b3c4b67042416c52b3fe4a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 28 Oct 2014 07:43:33 -0700 Subject: Assigment in if statements This is one of the warnings that I agree with. The original code was very hard on my eyes... the explicit comparison to NULL is just so much easier to understand when reading the code. Signed-off-by: Dirk Hohndel --- file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file.c b/file.c index 7ffe8a6c1..9861a037c 100644 --- a/file.c +++ b/file.c @@ -715,14 +715,14 @@ int parse_seabear_csv_file(const char *filename, int timef, int depthf, int temp /* Determine NL (new line) character and the start of CSV data */ ptr = mem.buffer; - while (ptr = strstr(ptr, "\r\n\r\n")) { + while ((ptr = strstr(ptr, "\r\n\r\n")) != NULL) { ptr_old = ptr; ptr += 1; NL = "\r\n"; } if (!ptr_old) { - while (ptr = strstr(ptr, "\n\n")) { + while ((ptr = strstr(ptr, "\n\n")) != NULL) { ptr_old = ptr; ptr += 1; } -- cgit v1.2.3-70-g09d2