I have developed a label widget which I use in my upcomming game. The label has a SetCaption function which is set regurlarly in my mainloop.
The following code works fine on PC, but on PPC it simply crash.
Never mind that this could have been optimized a lot. I just want it to work :roll:
If I substitute
Anyone out there got an idea what's going on?
-Thomas
The following code works fine on PC, but on PPC it simply crash.
- Code:
void CGuiLabel::SetCaption(TCHAR* text)
{
if (text != NULL)
{
if (caption != NULL)
free(caption);
int length = _tcslen(text);
caption = (TCHAR*)malloc(length);
_stprintf(caption, text);
}
}
Never mind that this could have been optimized a lot. I just want it to work :roll:
If I substitute
- Code:
text
- Code:
TEXT("MyCaption");
Anyone out there got an idea what's going on?
-Thomas