summaryrefslogtreecommitdiff
path: root/modules/core
diff options
context:
space:
mode:
authorDukePyrolator <DukePyrolator@anope.org>2010-12-28 07:00:47 +0100
committerDukePyrolator <DukePyrolator@anope.org>2010-12-28 07:00:47 +0100
commitfd7f542bd9fadb6b17618c8cda898b795be2c03f (patch)
tree5e78be7a79d7f0dddf8862b82124979f8ae0038e /modules/core
parentf638d1078ab5ab630ce9393fe87edd630abdf75a (diff)
parent5ead326454ccc369f8b3b4ef91971b45e7e01072 (diff)
Merge branch '1.9' of ssh://anope.git.sourceforge.net/gitroot/anope/anope into 1.9
Diffstat (limited to 'modules/core')
-rw-r--r--modules/core/ms_read.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/core/ms_read.cpp b/modules/core/ms_read.cpp
index 31f701c7e..db26fd689 100644
--- a/modules/core/ms_read.cpp
+++ b/modules/core/ms_read.cpp
@@ -49,7 +49,7 @@ class MemoListCallback : public NumberList
class CommandMSRead : public Command
{
public:
- CommandMSRead() : Command("READ", 0, 2)
+ CommandMSRead() : Command("READ", 1, 2)
{
}
@@ -59,8 +59,7 @@ class CommandMSRead : public Command
MemoInfo *mi;
ChannelInfo *ci = NULL;
- Anope::string numstr = !params.empty() ? params[0] : "", chan;
- int num;
+ Anope::string numstr = params[0], chan;
if (!numstr.empty() && numstr[0] == '#')
{
@@ -81,8 +80,8 @@ class CommandMSRead : public Command
}
else
mi = &u->Account()->memos;
- num = !numstr.empty() && numstr.is_number_only() ? convertTo<int>(numstr) : -1;
- if (numstr.empty() || (!numstr.equals_ci("LAST") && !numstr.equals_ci("NEW") && num <= 0))
+
+ if (numstr.empty() || (!numstr.equals_ci("LAST") && !numstr.equals_ci("NEW") && !numstr.is_number_only()))
this->OnSyntaxError(source, numstr);
else if (mi->memos.empty())
{
@@ -91,7 +90,8 @@ class CommandMSRead : public Command
else
source.Reply(MEMO_HAVE_NO_MEMOS);
}
- else {
+ else
+ {
int i, end;
if (numstr.equals_ci("NEW"))