diff options
author | Kent Mein <mein@cs.umn.edu> | 2007-09-17 19:39:03 +0400 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2007-09-17 19:39:03 +0400 |
commit | d1e5c86b76501cef3ad5d5ae70825fc6398d642f (patch) | |
tree | decf199b2f0c37f180bfd54ecda9cc724c183913 /source | |
parent | ed47851517b9048829aec4c5a3025cdb482715dd (diff) |
Added a NULL check that was needed.
Kent
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/filesel.c | 4 | ||||
-rw-r--r-- | source/blender/src/language.c | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c index f4b9d47becf..1bdca25a88d 100644 --- a/source/blender/src/filesel.c +++ b/source/blender/src/filesel.c @@ -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 diff --git a/source/blender/src/language.c b/source/blender/src/language.c index 7864468287e..c289d75f88b 100644 --- a/source/blender/src/language.c +++ b/source/blender/src/language.c @@ -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); } |