From f22bbb97df3693b5e0700a8afb6dbcbdb4b835af Mon Sep 17 00:00:00 2001 From: siddontang Date: Thu, 18 Sep 2014 09:08:18 +0800 Subject: [PATCH] bugfix scan count 0 --- server/cmd_kv.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/cmd_kv.go b/server/cmd_kv.go index 44eccf1..c170601 100644 --- a/server/cmd_kv.go +++ b/server/cmd_kv.go @@ -295,10 +295,8 @@ func parseScanArgs(c *client) (key []byte, match string, count int, err error) { switch strings.ToLower(ledis.String(args[1])) { case "match": match = ledis.String(args[2]) - return case "count": count, err = strconv.Atoi(ledis.String(args[2])) - return default: err = ErrCmdParams return @@ -314,7 +312,10 @@ func parseScanArgs(c *client) (key []byte, match string, count int, err error) { match = ledis.String(args[2]) count, err = strconv.Atoi(ledis.String(args[4])) - return + } + + if count <= 0 { + err = ErrCmdParams } return