Added a NULL check that was needed.

Kent
This commit is contained in:
2007-09-17 15:39:03 +00:00
parent ed47851517
commit d1e5c86b76
2 changed files with 8 additions and 6 deletions

View File

@@ -806,8 +806,8 @@ static void print_line(SpaceFile *sfile, struct direntry *files, int x, int y)
struct LANGMenuEntry *lme;
lme = find_language(U.language);
if (!strcmp(lme->code, "ja_JP") ||
!strcmp(lme->code, "zh_CN"))
if ((lme !=NULL) && (!strcmp(lme->code, "ja_JP") ||
!strcmp(lme->code, "zh_CN")))
{
BIF_RasterPos((float)x, (float)y);
#ifdef WIN32

View File

@@ -128,10 +128,12 @@ int BIF_DrawString(BMF_Font* font, char *str, int translate)
struct LANGMenuEntry *lme;
lme = find_language(U.language);
if (!strcmp(lme->code, "ja_JP"))
string_to_utf8(str, utf_8, "Shift_JIS"); /* Japanese */
else if (!strcmp(lme->code, "zh_CN"))
string_to_utf8(str, utf_8, "GB2312"); /* Chinese */
if (lme !=NULL) {
if (!strcmp(lme->code, "ja_JP"))
string_to_utf8(str, utf_8, "Shift_JIS"); /* Japanese */
else if (!strcmp(lme->code, "zh_CN"))
string_to_utf8(str, utf_8, "GB2312"); /* Chinese */
}
return FTF_DrawString(utf_8, FTF_INPUT_UTF8);
}