summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-28 07:43:33 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-28 07:43:33 -0700
commit70a2e91f1cb41a09d9b3c4b67042416c52b3fe4a (patch)
treedbb10555429a2b168a8c41a0c84e3582b57f18e0 /file.c
parent85df7ebb0288fa988c83e3783ae7eb0d10567960 (diff)
downloadsubsurface-70a2e91f1cb41a09d9b3c4b67042416c52b3fe4a.tar.gz
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>
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files 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;
}