summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-25 21:41:07 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-31 23:06:29 +0300
commitf0d5be2db32afc7b4382276ffa3c60a1354bea8e (patch)
tree919fc1db442339a32a88bde0fa6f68e320e64dce /src/map/atcommand.c
parenta71a056abb8931aa4a11d0cde296fe9de68ee6df (diff)
downloadhercules-f0d5be2db32afc7b4382276ffa3c60a1354bea8e.tar.gz
hercules-f0d5be2db32afc7b4382276ffa3c60a1354bea8e.tar.bz2
hercules-f0d5be2db32afc7b4382276ffa3c60a1354bea8e.tar.xz
hercules-f0d5be2db32afc7b4382276ffa3c60a1354bea8e.zip
Add some missing null pointer checks after automatic checks.
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 330fe6284..74a9531e5 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1315,9 +1315,7 @@ ACMD(baselevelup)
{
int level=0, i=0, status_point=0;
- level = atoi(message);
-
- if (!message || !*message || !level) {
+ if (!message || !*message || !(level = atoi(message))) {
clif->message(fd, msg_txt(986)); // Please enter a level adjustment (usage: @lvup/@blevel/@baselvlup <number of levels>).
return false;
}
@@ -1376,9 +1374,7 @@ ACMD(joblevelup)
{
int level=0;
- level = atoi(message);
-
- if (!message || !*message || !level) {
+ if (!message || !*message || !(level = atoi(message))) {
clif->message(fd, msg_txt(987)); // Please enter a level adjustment (usage: @joblvup/@jlevel/@joblvlup <number of levels>).
return false;
}
@@ -8570,10 +8566,12 @@ ACMD(cart) {
sd->status.skill[idx].flag = (x)?1:0; \
} while(0)
- int val = atoi(message);
+ int val;
bool need_skill = pc->checkskill(sd, MC_PUSHCART) ? false : true;
unsigned int index = skill->get_index(MC_PUSHCART);
+ if (message)
+ val = atoi(message);
if( !message || !*message || val < 0 || val > MAX_CARTS ) {
sprintf(atcmd_output, msg_txt(1390),command,MAX_CARTS); // Unknown Cart (usage: %s <0-%d>).
clif->message(fd, atcmd_output);