fixed bad memory access in case an int token is not set

This commit is contained in:
louis 2016-03-21 22:47:35 +01:00
parent 2ba17dda6a
commit 15feb0e16e
1 changed files with 4 additions and 2 deletions

View File

@ -1220,8 +1220,10 @@ char *cTextExpr::DeterminateText(void) {
strcat(retVal, str);
} else if (t->type == eTexttokenType::inttoken) {
int value = tokenContainer->IntToken(t->tokenIndex);
cString str = cString::sprintf("%d", value);
strcat(retVal, *str);
if (value > 0) {
cString str = cString::sprintf("%d", value);
strcat(retVal, *str);
}
} else if (t->type == eTexttokenType::looptoken && loopInfo && loopInfo->row >= 0) {
char *str = tokenContainer->LoopToken(loopInfo->index, loopInfo->row, t->tokenIndex);
if (str)