Skip to content

Commit

Permalink
String trim fix for missing final character
Browse files Browse the repository at this point in the history
This fixes the off-by-one error reported by ununnilium in the forum.

The final character of model and the final character of serial number
were being deleted. For instance,

Model:          WDC WD30EFRX-68EUZN0
Serial Number:  WD-WMC4N0H2JLJP

should become WDC_WD30EFRX-68EUZN0-WD-WMC4N0H2JLJP not
WDC_WD30EFRX-68EUZN-WD-WMC4N0H2JLJ.
  • Loading branch information
ilovezfs committed Feb 19, 2015
1 parent a0cf42c commit 6776d46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion InvariantDisks/IDSerialLinker.cpp
Expand Up @@ -53,7 +53,7 @@ namespace ID
size_t first = s.find_first_not_of(' ');
size_t last = s.find_last_not_of(' ');
if (first != std::string::npos)
return s.substr(first, last - first);
return s.substr(first, last - first + 1);
return s;
}

Expand Down

0 comments on commit 6776d46

Please sign in to comment.