From e25cecf37caa9d526de5dab102411798f42fd5e9 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Mon, 11 Sep 2017 07:06:56 +0300 Subject: Inform user if there was no dive profile in DL7/ZXU file Signed-off-by: Miika Turkia --- core/file.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/file.c b/core/file.c index c90d394aa..874a4e2c3 100644 --- a/core/file.c +++ b/core/file.c @@ -945,6 +945,10 @@ int parse_dan_format(const char *filename, char **params, int pnr) params[pnr + 6] = NULL; ptr = strstr(ptr, "ZDP{"); + if (ptr && ptr[4] == '}') { + end_ptr += ptr - (char *)mem_csv.buffer; + return report_error(translate("gettextFromC", "No dive profile found from '%s'"), filename); + } if (ptr) ptr = strstr(ptr, NL); if (ptr) -- cgit v1.2.3-70-g09d2