From 811513f17e9412ba131b4447138f620392ebd645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Fri, 12 Feb 2016 12:27:25 +0100 Subject: [PATCH] Print message and exit when no suffixes are found --- src/psl2c.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/psl2c.c b/src/psl2c.c index 8531d40..2a4549c 100644 --- a/src/psl2c.c +++ b/src/psl2c.c @@ -256,6 +256,11 @@ int main(int argc, const char **argv) if (!(psl = psl_load_file(argv[argpos]))) return 2; + if (!psl->suffixes || !psl->nsuffixes) { + fprintf(stderr, "Failed to load PSL. Please check content of '%s'.\n", argv[argpos]); + return 5; + } + /* look for ambiguous or double entries */ /* if (_check_psl(psl)) { psl_free(psl);