summary refs log tree commit diff
path: root/src/libutil/util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r--src/libutil/util.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index f34bd9e059..02745498f9 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -360,10 +360,7 @@ Nest::~Nest()
 
 static string escVerbosity(Verbosity level)
 {
-    int l = (int) level;
-    ostringstream st;
-    st << l;
-    return st.str();
+    return int2String((int) level);
 }
 
 
@@ -829,6 +826,14 @@ bool statusOk(int status)
 }
 
 
+string int2String(int n)
+{
+    ostringstream str;
+    str << n;
+    return str.str();
+}
+
+
 bool string2Int(const string & s, int & n)
 {
     istringstream str(s);