make CCallsign::m_sz mutable

pull/1/head
Tom Early 5 years ago
parent e6235bc340
commit e488070587

@ -331,23 +331,20 @@ bool CCallsign::operator ==(const CCallsign &callsign) const
CCallsign::operator const char *() const
{
char *sz = (char *)(const char *)m_sz;
// empty
::memset(sz, 0, sizeof(m_sz));
::memset(m_sz, 0, sizeof(m_sz));
// callsign
sz[CALLSIGN_LEN] = 0;
::memcpy(sz, m_Callsign, sizeof(m_Callsign));
::memcpy(m_sz, m_Callsign, sizeof(m_Callsign));
// module
if ( HasModule() )
{
sz[sizeof(m_Callsign)] = m_Module;
m_sz[sizeof(m_Callsign)] = m_Module;
}
// suffix
if ( HasSuffix() )
{
::strcat(sz, " / ");
::strncat(sz, m_Suffix, sizeof(m_Suffix));
::strcat(m_sz, " / ");
::strncat(m_sz, m_Suffix, sizeof(m_Suffix));
}
// done

@ -91,7 +91,7 @@ protected:
char m_Callsign[CALLSIGN_LEN];
char m_Suffix[CALLSUFFIX_LEN];
char m_Module;
char m_sz[CALLSIGN_LEN+CALLSUFFIX_LEN+5];
mutable char m_sz[CALLSIGN_LEN+CALLSUFFIX_LEN+5];
#ifndef NO_XLX
uint32 m_uiDmrid;
#endif

Loading…
Cancel
Save

Powered by TurnKey Linux.