* stuffextract: fixed crash with invalid locale autodetection

This commit is contained in:
False.Genesis 2007-10-03 01:30:27 +00:00
parent 192eda63da
commit f4829928e8

View File

@ -38,7 +38,7 @@ int main(int argc, char *argv[])
memcpy(loc,input,4); loc[4]=0; memcpy(loc,input,4); loc[4]=0;
SetLocale(loc); SetLocale(loc);
} }
if(FileExists(std::string("Data/")+GetLocale()+"/locale-"+GetLocale()+".MPQ")) if(GetLocale() && FileExists(std::string("Data/")+GetLocale()+"/locale-"+GetLocale()+".MPQ"))
{ {
printf("Locale \"%s\" seems valid, starting conversion...\n",GetLocale()); printf("Locale \"%s\" seems valid, starting conversion...\n",GetLocale());
CreateDir("stuffextract"); CreateDir("stuffextract");