address comment
Signed-off-by: xhe <xw897002528@gmail.com>
This commit is contained in:
parent
f6711b7da5
commit
78eaf503fd
@ -2763,15 +2763,16 @@ void helloCommand(client *c) {
|
|||||||
long long ver = 0;
|
long long ver = 0;
|
||||||
int next_arg = 1;
|
int next_arg = 1;
|
||||||
|
|
||||||
if (c->argc >= 2 && getLongLongFromObject(c->argv[next_arg++],&ver) == C_OK &&
|
if (c->argc >= 2) {
|
||||||
(ver < 2 || ver > 3)) {
|
if (getLongLongFromObjectOrReply(c, c->argv[next_arg++], &ver,
|
||||||
addReplyError(c,"-NOPROTO unsupported protocol version");
|
"The second argument should the protocol version if provided") != C_OK) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ver && next_arg < c->argc) {
|
if (ver < 2 || ver > 3) {
|
||||||
addReplyError(c,"Need to provide an protocol version for other arguments");
|
addReplyError(c,"-NOPROTO unsupported protocol version");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = next_arg; j < c->argc; j++) {
|
for (int j = next_arg; j < c->argc; j++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user