From 1b93b9dfd294da69b3cfb75c4274e87938bdf453 Mon Sep 17 00:00:00 2001 From: Andreas Huggel Date: Mon, 12 Apr 2010 16:13:42 +0000 Subject: [PATCH] Retain value in case of stream error. (Suggested by Thomas Beutlich) --- src/value.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/value.hpp b/src/value.hpp index 7790002d..d47c3450 100644 --- a/src/value.hpp +++ b/src/value.hpp @@ -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; }