Subversion Repositories filter_foundry

Compare Revisions

Regard whitespace Rev 495 → Rev 496

/trunk/language.c
43,6 → 43,7
#endif
}
 
// Attention: Requires FF_GetMsg_Free(), otherwise memory is leaked
TCHAR* FF_GetMsg_Cpy(int MsgId) {
#ifdef WIN_ENV
TCHAR* szMsg;
49,7 → 50,7
int len;
TCHAR* ret;
len = LoadString(hDllInstance, MsgId, (LPTSTR)&szMsg, 0);
ret = (TCHAR*)malloc((len+1) * sizeof(TCHAR)); // TODO: This leaks memory! Like _strdup() does... Not a good design!
ret = (TCHAR*)malloc((len+1) * sizeof(TCHAR));
if (ret == NULL) return NULL;
LoadString(hDllInstance, MsgId, ret, len+1);
return ret;
56,8 → 57,13
#else
Str255 msg;
TCHAR* ret;
ret = (TCHAR*)malloc((len + 1) * sizeof(TCHAR));
GetIndString(msg, 1000, MsgId);
myp2cstrcpy(ret, msg);
return ret;
#endif
}
 
void FF_GetMsg_Free(TCHAR* str) {
free(str);
}