diff options
Diffstat (limited to 'modules/memoserv/ms_set.cpp')
-rw-r--r-- | modules/memoserv/ms_set.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/modules/memoserv/ms_set.cpp b/modules/memoserv/ms_set.cpp index 83b28fb20..54ad7c252 100644 --- a/modules/memoserv/ms_set.cpp +++ b/modules/memoserv/ms_set.cpp @@ -135,12 +135,8 @@ private: else nc->Shrink<bool>("MEMO_HARDMAX"); } - limit = -1; - try - { - limit = convertTo<int16_t>(p1); - } - catch (const ConvertException &) { } + + limit = Anope::Convert<int16_t>(p1, -1); } else { @@ -160,12 +156,8 @@ private: return; } int max_memos = Config->GetModule("memoserv")->Get<int>("maxmemos"); - limit = -1; - try - { - limit = convertTo<int16_t>(p1); - } - catch (const ConvertException &) { } + limit = Anope::Convert<int16_t>(p1, -1); + /* The first character is a digit, but we could still go negative * from overflow... watch out! */ if (limit < 0 || (max_memos > 0 && limit > max_memos)) |