mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-06-02 20:41:38 +00:00
Debugger: Symbol loading: Fix random crash upon start up. (PR #694)
This commit is contained in:
parent
bd730e25c0
commit
cb007df40b
|
@ -622,10 +622,13 @@ int ParseSymbolTable(const std::string & pPathFileName, SymbolTable_Index_e eSym
|
||||||
p = strstr(szLine, ";"); // Optional
|
p = strstr(szLine, ";"); // Optional
|
||||||
if(p) *p = 0;
|
if(p) *p = 0;
|
||||||
p = strstr(szLine, " "); // 1st space between name & value
|
p = strstr(szLine, " "); // 1st space between name & value
|
||||||
int nLen = p - szLine;
|
if (p)
|
||||||
if (nLen > MAX_SYMBOLS_LEN)
|
|
||||||
{
|
{
|
||||||
memset(&szLine[MAX_SYMBOLS_LEN], ' ', nLen-MAX_SYMBOLS_LEN); // sscanf fails for nAddress if string too long
|
int nLen = p - szLine;
|
||||||
|
if (nLen > MAX_SYMBOLS_LEN)
|
||||||
|
{
|
||||||
|
memset(&szLine[MAX_SYMBOLS_LEN], ' ', nLen - MAX_SYMBOLS_LEN); // sscanf fails for nAddress if string too long
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sscanf(szLine, sFormat2, sName, &nAddress);
|
sscanf(szLine, sFormat2, sName, &nAddress);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user