aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r--src/libutil/util.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 1873ccfe5..4f6c367da 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -1020,6 +1020,14 @@ bool string2Int(const string & s, int & n)
}
+bool string2Int(const string & s, long long & n)
+{
+ std::istringstream str(s);
+ str >> n;
+ return str && str.get() == EOF;
+}
+
+
void ignoreException()
{
try {