diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-07-06 13:59:14 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-06 13:59:14 -0700 |
commit | b1538c809d0ce5abe489822f9d2b21287a0a38d5 (patch) | |
tree | 303fbcb44fbd14d0039293cdc7e9a34e8b2424ba /liquivision.c | |
parent | e76675d4df466448a33532895dd371aa498a0e49 (diff) | |
download | subsurface-b1538c809d0ce5abe489822f9d2b21287a0a38d5.tar.gz |
Code cleanup
Make precedence of && over || explicit.
Explicitly convert between char * and unsigned char *.
Don't assign potentially negative return code to an unsigend variable.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'liquivision.c')
-rw-r--r-- | liquivision.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/liquivision.c b/liquivision.c index cabfa0b17..957e7ccf9 100644 --- a/liquivision.c +++ b/liquivision.c @@ -142,9 +142,9 @@ static void parse_dives (int log_version, const unsigned char *buf, unsigned int memcpy(location + len, ", ", 2); memcpy(location + len + 2, buf + ptr + len + 4, place_len); } else if (len) { - location = strndup(buf + ptr, len); + location = strndup((char *)buf + ptr, len); } else if (place_len) { - location = strndup(buf + ptr + len + 4, place_len); + location = strndup((char *)buf + ptr + len + 4, place_len); } /* Store the location only if we have one */ @@ -160,8 +160,8 @@ static void parse_dives (int log_version, const unsigned char *buf, unsigned int ptr += 4; // Blank notes are better than the default text - if (len && strncmp(buf + ptr, "Comment ...", 11)) { - dive->notes = strndup(buf + ptr, len); + if (len && strncmp((char *)buf + ptr, "Comment ...", 11)) { + dive->notes = strndup((char *)buf + ptr, len); } ptr += len; |