projects
/
NeonServV5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e0508fc
)
we shouldn't parse args if there are no args
author
pk910
<philipp@zoelle1.de>
Sat, 13 Aug 2011 00:45:46 +0000
(
02:45
+0200)
committer
pk910
<philipp@zoelle1.de>
Sat, 13 Aug 2011 00:45:46 +0000
(
02:45
+0200)
modcmd.c
patch
|
blob
|
history
diff --git
a/modcmd.c
b/modcmd.c
index 1f6a5415cc8c366c97d9f131aabf421a3d1cb29e..6db797b257733afaa03b4061cd45054f7c7b06f4 100644
(file)
--- a/
modcmd.c
+++ b/
modcmd.c
@@
-85,15
+85,17
@@
static void handle_command(struct ClientSocket *client, struct UserNode *user, s
char *arga[MAXNUMPARAMS];
char **argv;
int argc = 0;
char *arga[MAXNUMPARAMS];
char **argv;
int argc = 0;
- while(*args) {
- //skip leading spaces
- while (*args == ' ')
- *args++ = 0;
- arga[argc++] = args;
- if (argc >= MAXNUMPARAMS)
- break;
- while (*args != ' ' && *args)
- args++;
+ if(args) {
+ while(*args) {
+ //skip leading spaces
+ while (*args == ' ')
+ *args++ = 0;
+ arga[argc++] = args;
+ if (argc >= MAXNUMPARAMS)
+ break;
+ while (*args != ' ' && *args)
+ args++;
+ }
}
argv = arga;
if(argc != 0 && argv[0][0] == '#') {
}
argv = arga;
if(argc != 0 && argv[0][0] == '#') {