Added a NULL check that was needed.
Kent
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user