Skip to content

Commit 2e9d446

Browse files
authored
Handle zero-length string in UnitAlgebra::trim() (#1210)
1 parent 2b5e873 commit 2e9d446

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/sst/core/unitAlgebra.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ Units::toString() const
321321
string
322322
UnitAlgebra::trim(const std::string& str)
323323
{
324+
if ( !str.size() ) return str;
325+
324326
// Find whitespace in front
325327
int front_index = 0;
326328
while ( isspace(str[front_index]) )

0 commit comments

Comments
 (0)