From 5af84139a8d04ad9fdb2c02bc242ce5cd50b87b9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 18 Jun 2008 15:20:33 +0000 Subject: * --max-freed: support values >= 4 GB. --- src/libutil/util.cc | 8 ++++++++ src/libutil/util.hh | 1 + 2 files changed, 9 insertions(+) (limited to 'src/libutil') diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 1873ccfe536c..4f6c367da8b1 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 { diff --git a/src/libutil/util.hh b/src/libutil/util.hh index d1e30fa6b9e3..5d28a8308cb8 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -287,6 +287,7 @@ bool statusOk(int status); /* Parse a string into an integer. */ string int2String(int n); bool string2Int(const string & s, int & n); +bool string2Int(const string & s, long long & n); /* Exception handling in destructors: print an error message, then -- cgit 1.4.1