Retain value in case of stream error. (Suggested by Thomas Beutlich)

This commit is contained in:
Andreas Huggel 2010-04-12 16:13:42 +00:00
parent c498837b66
commit 1b93b9dfd2

View File

@ -1515,12 +1515,13 @@ namespace Exiv2 {
{
std::istringstream is(buf);
T tmp;
value_.clear();
ValueList val;
while (!(is.eof())) {
is >> tmp;
if (is.fail()) return 1;
value_.push_back(tmp);
val.push_back(tmp);
}
value_.swap(val);
return 0;
}