From: Richard W.M. Jones Date: Thu, 6 Oct 2011 12:50:45 +0000 (+0100) Subject: helper: Improve error message when run on random files (thanks Alexey Torkhov). X-Git-Tag: 3.11~6 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=6d9051df32b90c6a4fe6ca1ff9e771b7dfe004fa;p=febootstrap.git helper: Improve error message when run on random files (thanks Alexey Torkhov). --- diff --git a/helper/appliance.c b/helper/appliance.c index b2cc840..c4d0b32 100644 --- a/helper/appliance.c +++ b/helper/appliance.c @@ -284,7 +284,9 @@ add_hostfiles (const char *hostfiles_file, struct writer *writer) if (strchr (hostfile, '*') || strchr (hostfile, '?')) { char *dirname = xstrdup (hostfile); char *patt = strrchr (dirname, '/'); - assert (patt); + if (!patt) + error (EXIT_FAILURE, 0, "%s: line %zu: invalid pattern\n(is this file a supermin appliance hostfiles file?)", + hostfiles_file, i+1); *patt++ = '\0'; char **files = read_dir (dirname);