diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2018-12-19 17:41:14 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2018-12-23 16:58:20 +0100 |
commit | 9469738df798ab397e1d27b662a5d45a307cab6b (patch) | |
tree | c09384b21be36c74e894a552dc6132e52431c6f6 /src/Utilities.cpp | |
parent | 45f536a701107c1c2c5c6acb22b62737f6b634b1 (diff) | |
download | astra-9469738df798ab397e1d27b662a5d45a307cab6b.tar.gz astra-9469738df798ab397e1d27b662a5d45a307cab6b.tar.bz2 astra-9469738df798ab397e1d27b662a5d45a307cab6b.tar.xz astra-9469738df798ab397e1d27b662a5d45a307cab6b.zip |
Add error checking to numeric vector config parsing
Diffstat (limited to 'src/Utilities.cpp')
-rw-r--r-- | src/Utilities.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Utilities.cpp b/src/Utilities.cpp index dc654ea..b14b444 100644 --- a/src/Utilities.cpp +++ b/src/Utilities.cpp @@ -93,6 +93,8 @@ std::vector<T> stringToNumericVector(const std::string &s) iss.clear(); T f; iss >> f; + if (iss.fail() || !iss.eof()) + throw bad_cast(); out.push_back(f); current = next + 1; } while (next != std::string::npos && current != length); |