Catch empty file case. From Tobias Stoeckmann.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17051 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-04-12 12:22:52 +00:00
parent fced68ddd0
commit 495cb953e6
2 changed files with 4 additions and 0 deletions

View File

@@ -72,6 +72,8 @@ read_words (const char *filename, char ***ret_w)
w[n++] = wptr;
wptr += len + 1;
}
if (n == 0)
errx(1, "%s is an empty file, no words to try", filename);
*ret_w = w;
return n;
}

View File

@@ -67,6 +67,8 @@ read_words (const char *filename, char ***ret_w)
w[n++] = estrdup (buf);
}
*ret_w = w;
if (n == 0)
errx(1, "%s is an empty file, no words to try", filename);
return n;
}