From 24c4b7c68d283a4d1de72a3eb68f1268f1fe34e3 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 27 Nov 2010 17:18:34 +0200 Subject: Working version before block send priorization update --- src/utility.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/utility.h') diff --git a/src/utility.h b/src/utility.h index 4178e9d95..e6a09547b 100644 --- a/src/utility.h +++ b/src/utility.h @@ -603,5 +603,15 @@ inline bool is_yes(std::string s) return false; } +inline s32 stoi(std::string s, s32 min, s32 max) +{ + s32 i = atoi(s.c_str()); + if(i < min) + i = min; + if(i > max) + i = max; + return i; +} + #endif -- cgit v1.2.3