sds icon indicating copy to clipboard operation
sds copied to clipboard

Allow sdsrange to make a string with length 0.

Open iveqy opened this issue 11 years ago • 0 comments

sdsrange(str, 0, -2) should result in an empty string.

For example

sds str = sdsnew("hello"); while (sdslen(str) > 0) str = sdsrange(str, 0, -2);

Would result in an inifinty loop before but will work as expected after this patch.

iveqy avatar Jul 11 '14 20:07 iveqy