get -stringlist throws a standard exception if no strings are present
Framework for numerical computations, data analysis and visualisation
Brought to you by:
numere
The command get -stringlist throws an exception of type basic_string::erase if it is invoked without any available string.
Analysis:
In the following lines:
if (matchParams(sCmd, "asstr"))
sReturn.erase(sReturn.length()-3);
else
sReturn.erase(sReturn.length()-2);
there's a check missing, which ensures that sReturn actually contains at least 2 or 3 characters, respectively.
Implementation:
A check was implemented. Implementation test were passed successfully.
Documentation:
Not needed - bug fix.
Tests:
Single case - no explicit test needed: implementation tests ware sufficient.
Anonymous
Diff:
Diff:
Diff:
Diff: