Prevent mc from crashing when codepages is empty because of an bogus installation

Signed-off-by: Patrick Winnertz <winnie@debian.org>
This commit is contained in:
Patrick Winnertz 2009-07-01 07:58:58 +02:00
parent 1448fb99d6
commit 6cd8c978fe

View File

@ -149,6 +149,8 @@ get_codepage_index (const char *id)
int i;
if (strcmp (id, OTHER_8BIT) == 0)
return -1;
if (codepages == NULL)
return -1;
for (i = 0; codepages[i].id; ++i)
if (strcmp (id, codepages[i].id) == 0)
return i;