Revision: 40256
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40256
Author:   xiaoxiangquan
Date:     2011-09-16 08:32:46 +0000 (Fri, 16 Sep 2011)
Log Message:
-----------
fix NULL check for getenv("LANGUAGE")

Modified Paths:
--------------
    branches/soc-2011-garlic/source/blender/blenfont/intern/blf_lang.c

Modified: branches/soc-2011-garlic/source/blender/blenfont/intern/blf_lang.c
===================================================================
--- branches/soc-2011-garlic/source/blender/blenfont/intern/blf_lang.c  
2011-09-16 08:20:21 UTC (rev 40255)
+++ branches/soc-2011-garlic/source/blender/blenfont/intern/blf_lang.c  
2011-09-16 08:32:46 UTC (rev 40256)
@@ -150,9 +150,10 @@
        {
                const char *locale;
                static char default_locale[64]="\0";
+               static char *env_language = getenv("LANGUAGE");
 
-               if(default_locale[0]==0) /* store defaul locale */
-                       strncpy(default_locale, getenv("LANGUAGE"), 
sizeof(default_locale));
+               if(default_locale[0]==0 && env_language!=NULL) /* store defaul 
locale */
+                       strncpy(default_locale, env_language, 
sizeof(default_locale));
 
                if(short_locale[0])
                        locale= short_locale;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to