summaryrefslogtreecommitdiffstats
path: root/bstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'bstr.c')
-rw-r--r--bstr.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/bstr.c b/bstr.c
index a2a49cc371..219c136d7c 100644
--- a/bstr.c
+++ b/bstr.c
@@ -129,8 +129,7 @@ struct bstr bstr_splice(struct bstr str, int start, int end)
end += str.len;
end = FFMIN(end, str.len);
start = FFMAX(start, 0);
- if (start >= end)
- return (struct bstr){NULL, 0};
+ end = FFMAX(end, start);
str.start += start;
str.len = end - start;
return str;