summaryrefslogtreecommitdiffhomepage
path: root/stc
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-05-10 17:41:03 +0200
committerTyge Løvset <[email protected]>2021-05-10 17:41:03 +0200
commit1401833dbfc8a08bf94978e98c76904aa82d3878 (patch)
tree4867e1b19c0705492cba7d56eefae0ab006a681f /stc
parentaa3851a95e700bb391eec1610d3b99aca97faaa8 (diff)
downloadSTC-modified-1401833dbfc8a08bf94978e98c76904aa82d3878.tar.gz
STC-modified-1401833dbfc8a08bf94978e98c76904aa82d3878.zip
added multimap example.
Diffstat (limited to 'stc')
-rw-r--r--stc/cstr.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/stc/cstr.h b/stc/cstr.h
index c9f6ccfd..d24e112e 100644
--- a/stc/cstr.h
+++ b/stc/cstr.h
@@ -320,6 +320,7 @@ cstr_replace_all(cstr* self, const char* find, const char* replace) {
cstr_append(&out, replace);
from = pos + find_len; ++n;
}
+ if (!n) return 0;
cstr_append(&out, self->str + from);
cstr_del(self); *self = out;
return n;