Re: [Plib-users] PUI: getLegend bug?
Brought to you by:
sjbaker
From: Eero P. <epa...@ko...> - 2003-03-19 19:03:53
|
SkyFlash wrote: > > Well, what I did was something like this: > > string charactername; > > if (characterexists) > m_characterselect->setLegend (charactername.c_str()) > else > m_characterselect->setLegend ("None") > I get a creepy feeling when I see the c_str()... The value returned from it certainly doesn't stay valid if you in anyway change the charactername string, including allowing it to go out of scope. On the other hand even if I understand how this would cause corrupted output, it is not so obvious what would cause the actual crash. That might depend on the malloc implementation though. Eero |