diff --git a/src/string.c b/src/string.c index 6eb5e18..1426def 100644 --- a/src/string.c +++ b/src/string.c @@ -62,6 +62,10 @@ char *string_replace_at(const char *src, unsigned int from, unsigned int to, unsigned long rpl_len; char *dst; + if (to < from) { + return ""; + } + src_len = strnlen(src, STR_LEN * STR_LEN); rpl_len = strnlen(rpl, STR_LEN * STR_LEN);