summaryrefslogtreecommitdiffhomepage
path: root/cstring.h
diff options
context:
space:
mode:
authortylo <[email protected]>2020-03-10 10:52:26 +0100
committertylo <[email protected]>2020-03-10 10:52:26 +0100
commit5aab7dcd61c70cb33794f79f2e88b8d82538fa65 (patch)
treee46599654013fdc0c4358f9fb435df9aafe1a0e0 /cstring.h
parentdd30f5c701609a8c6dc09b9b48967df54767b7ed (diff)
parent1f93cd63a5e2f13d5954c7519c7869ba6c870427 (diff)
downloadSTC-modified-5aab7dcd61c70cb33794f79f2e88b8d82538fa65.tar.gz
STC-modified-5aab7dcd61c70cb33794f79f2e88b8d82538fa65.zip
Merge branch 'master' of https://github.com/tylo-work/C99Containers
# Conflicts: # cmap.h
Diffstat (limited to 'cstring.h')
-rw-r--r--cstring.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/cstring.h b/cstring.h
index 02dd3446..f877847c 100644
--- a/cstring.h
+++ b/cstring.h
@@ -138,10 +138,10 @@ static inline void _cstring_internalMove(CString* self, size_t pos1, size_t pos2
}
static inline void cstring_insertN(CString* self, size_t pos, const char* str, size_t n) {
- char* xstr = (char *) memcpy(n > _cdef_max_alloca ? malloc(n) : alloca(n), str, n);
+ char* xstr = (char *) memcpy(n > cdef_max_alloca ? malloc(n) : alloca(n), str, n);
_cstring_internalMove(self, pos, pos + n);
memcpy(&self->str[pos], xstr, n);
- if (n > _cdef_max_alloca) free(xstr);
+ if (n > cdef_max_alloca) free(xstr);
}
static inline void cstring_insert(CString* self, size_t pos, const char* str) {
@@ -161,10 +161,10 @@ static inline size_t cstring_findN(CString cs, size_t pos, const char* needle, s
static inline size_t cstring_replaceN(CString* self, size_t pos, const char* s1, size_t n1, const char* s2, size_t n2) {
size_t pos2 = cstring_findN(*self, pos, s1, n1);
if (pos2 == cstring_npos) return cstring_npos;
- char* xs2 = (char *) memcpy(n2 > _cdef_max_alloca ? malloc(n2) : alloca(n2), s2, n2);
+ char* xs2 = (char *) memcpy(n2 > cdef_max_alloca ? malloc(n2) : alloca(n2), s2, n2);
_cstring_internalMove(self, pos2 + n1, pos2 + n2);
memcpy(&self->str[pos2], xs2, n2);
- if (n2 > _cdef_max_alloca) free(xs2);
+ if (n2 > cdef_max_alloca) free(xs2);
return pos2;
}