i18n array smashing fix.
This commit is contained in:
parent
a138e71455
commit
2ad4de22bf
|
@ -72,12 +72,7 @@ void setLanguage(char *applicationName, char *languageCode)
|
||||||
STRNCPY(language, languageCode, MAX_LINE_LENGTH);
|
STRNCPY(language, languageCode, MAX_LINE_LENGTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strstr(language, ".") != NULL)
|
strtok(language, ".");
|
||||||
{
|
|
||||||
lang = strtok(language, ".");
|
|
||||||
|
|
||||||
STRNCPY(language, lang, MAX_LINE_LENGTH);
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Locale is %s", language);
|
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Locale is %s", language);
|
||||||
|
|
||||||
|
@ -100,9 +95,7 @@ void setLanguage(char *applicationName, char *languageCode)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
lang = strtok(language, "_");
|
strtok(language, "_");
|
||||||
|
|
||||||
STRNCPY(language, lang, MAX_LINE_LENGTH);
|
|
||||||
|
|
||||||
sprintf(c, "%s/%s/LC_MESSAGES/%s.mo", LOCALE_DIR, language, applicationName);
|
sprintf(c, "%s/%s/LC_MESSAGES/%s.mo", LOCALE_DIR, language, applicationName);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue