summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cstr.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-09-05 18:21:53 +0200
committerTyge Løvset <[email protected]>2023-09-05 18:21:53 +0200
commita0a75ac1c324ac52931c9df37ce13cb4213ab711 (patch)
tree50a495316e043a34caaaf4987c894103b0f457d1 /include/stc/cstr.h
parent493c34e9c2de0587f38681340db8f2735e72d7dd (diff)
downloadSTC-modified-a0a75ac1c324ac52931c9df37ce13cb4213ab711.tar.gz
STC-modified-a0a75ac1c324ac52931c9df37ce13cb4213ab711.zip
Swapped two parameters in newly renamed "internal" function stc_strnstrn().
Diffstat (limited to 'include/stc/cstr.h')
-rw-r--r--include/stc/cstr.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/stc/cstr.h b/include/stc/cstr.h
index d2faeb62..f7e7b8ad 100644
--- a/include/stc/cstr.h
+++ b/include/stc/cstr.h
@@ -455,7 +455,7 @@ STC_DEF uint64_t cstr_hash(const cstr *self) {
STC_DEF intptr_t cstr_find_sv(const cstr* self, csview search) {
csview sv = cstr_sv(self);
- char* res = stc_strnstrn(sv.buf, search.buf, sv.size, search.size);
+ char* res = stc_strnstrn(sv.buf, sv.size, search.buf, search.size);
return res ? (res - sv.buf) : c_NPOS;
}
@@ -588,7 +588,7 @@ STC_DEF cstr cstr_replace_sv(csview in, csview search, csview repl, int32_t coun
intptr_t from = 0; char* res;
if (!count) count = INT32_MAX;
if (search.size)
- while (count-- && (res = stc_strnstrn(in.buf + from, search.buf, in.size - from, search.size))) {
+ while (count-- && (res = stc_strnstrn(in.buf + from, in.size - from, search.buf, search.size))) {
const intptr_t pos = (res - in.buf);
cstr_append_n(&out, in.buf + from, pos - from);
cstr_append_n(&out, repl.buf, repl.size);