From 7aaa539afe56fb7de99408ba95b55e423cf6856a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 29 Dec 2012 11:28:35 -0800 Subject: Make sure the model is non-NULL before comparing with it In commit 194a05b18911 "Correct the detection of existing dives in the Uemis downloader" I forgot to add that check before calling strcmp. Signed-off-by: Dirk Hohndel --- uemis-downloader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uemis-downloader.c b/uemis-downloader.c index 465437aa6..1c7b23887 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -733,7 +733,7 @@ static char *get_divenr(char *deviceidstr) for (i = 0; i < dive_table.nr; i++) { struct divecomputer *dc = &dive_table.dives[i]->dc; while (dc) { - if (!strcmp(dc->model, "Uemis Zurich") && + if (dc->model && !strcmp(dc->model, "Uemis Zurich") && dc->deviceid == deviceid && dc->diveid > maxdiveid) maxdiveid = dc->diveid; dc = dc->next; -- cgit v1.2.3-70-g09d2