bug fix: argument checking of funtion

This commit is contained in:
wenyekui 2014-07-23 17:10:06 +08:00
parent f95494386a
commit 0d01d7e7ed
1 changed files with 11 additions and 9 deletions

View File

@ -120,17 +120,18 @@ func zparseScoreRange(minBuf []byte, maxBuf []byte) (min int64, max int64, err e
if strings.ToLower(ledis.String(minBuf)) == "-inf" {
min = math.MinInt64
} else {
var lopen bool = false
if minBuf[0] == '(' {
lopen = true
minBuf = minBuf[1:]
}
if len(minBuf) == 0 {
err = ErrCmdParams
return
}
var lopen bool = false
if minBuf[0] == '(' {
lopen = true
minBuf = minBuf[1:]
}
min, err = ledis.StrInt64(minBuf, nil)
if err != nil {
return
@ -150,16 +151,17 @@ func zparseScoreRange(minBuf []byte, maxBuf []byte) (min int64, max int64, err e
max = math.MaxInt64
} else {
var ropen = false
if maxBuf[0] == '(' {
ropen = true
maxBuf = maxBuf[1:]
}
if len(maxBuf) == 0 {
err = ErrCmdParams
return
}
if maxBuf[0] == '(' {
ropen = true
maxBuf = maxBuf[1:]
}
max, err = ledis.StrInt64(maxBuf, nil)
if err != nil {
return