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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-10-28 07:43:33 -07:00
parent 85df7ebb02
commit 70a2e91f1c

4
file.c
View file

@ -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;
}