diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-06-21 22:07:10 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-21 22:11:49 -0700 |
commit | 895d6e0000b824809a19d42aee0955df76af8c86 (patch) | |
tree | 930c9f93eeacd619decb5f2d360ff615808ceafc /dive.c | |
parent | 2c0223fbb206b0552f137d0fb32d8bda848102b7 (diff) | |
download | subsurface-895d6e0000b824809a19d42aee0955df76af8c86.tar.gz |
Comparing the address of a member to 0 is pointless
Or... this code doesn't do what you think it does.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r-- | dive.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1055,10 +1055,10 @@ static struct event *find_previous_event(struct divecomputer *dc, struct event * struct event *ev = dc->events; struct event *previous = NULL; - if (!event->name) + if (same_string(event->name, "")) return NULL; while (ev && ev != event) { - if (ev->name && !strcmp(ev->name, event->name)) + if (same_string(ev->name, event->name)) previous = ev; ev = ev->next; } |