From 84d5bcf9de30d56a6523d4a650823f46700b75a8 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 27 Jan 2015 22:01:15 +0000 Subject: [PATCH] Cleanup and better error message --- src/grib_parse_utils.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/grib_parse_utils.c b/src/grib_parse_utils.c index b9a3eca64..aedee6f6a 100644 --- a/src/grib_parse_utils.c +++ b/src/grib_parse_utils.c @@ -404,7 +404,7 @@ int grib_yyerror(const char* msg) void grib_parser_include(const char* fname) { - FILE *f ; + FILE *f = NULL; char path[1204]; char* io_buffer=0; /* int i; */ @@ -426,7 +426,11 @@ void grib_parser_include(const char* fname) p++; } - Assert(q); + if(!q) { + grib_context_log(grib_parser_context, GRIB_LOG_FATAL, + "grib_parser_include: path '%s' does not contain a '/'\n",fname); + return; + } q++; strncpy(path,parse_file,q-parse_file);