antirez/sds — pull request #28 by iveqy (2014-07-11 20:52:08+00:00)
Title: Allow sdsrange to make a string with length 0.

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.