Fix substring operator in macro-processor.
The characters of the substring could be mixed with random characters from the memory space. Thanks to Tom Holden for reporting the bug. Closes #708issue#70
parent
56e1ed2f12
commit
6d22ae06cb
|
@ -387,7 +387,7 @@ StringMV::operator[](const MacroValue &mv) const throw (TypeError, OutOfBoundsEr
|
|||
if (*it < 1 || *it > (int) value.length())
|
||||
throw OutOfBoundsError();
|
||||
char c = value.at(*it - 1);
|
||||
result.append(&c);
|
||||
result.append(1, c);
|
||||
}
|
||||
return new StringMV(driver, result);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue