system/localize: change memory allocation, no user-visible changes (continued)

Origin commit data
------------------
Branch: ni/coolstream
Commit: 60705383eb
Author: martii <m4rtii@gmx.de>
Date: 2013-11-09 (Sat, 09 Nov 2013)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
martii
2013-11-09 17:07:53 +01:00
committed by vanhofen
parent 8b22f580a2
commit 2d01291316

View File

@@ -222,8 +222,15 @@ CLocaleManager::loadLocale_ret_t CLocaleManager::loadLocale(const char * const l
if(buf)
free(buf);
char *_mem = (char *) realloc(*mem, memp - *mem);
if (_mem) // I see no reason for realloc to fail here, but anyways ...
*mem = _mem;
if (_mem) {
if (_mem != *mem) {
// most likely doesn't happen
for(unsigned int i = 1; i < sizeof(locale_real_names)/sizeof(const char *); i++)
if (loadData[i] != locale_real_names[i])
loadData[i] -= *mem - _mem;
*mem = _mem;
}
}
for (unsigned j = 1; j < (sizeof(locale_real_names)/sizeof(const char *)); j++)
if (loadData[j] == locale_real_names[j])