MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_str_replace_char

Function cbm_str_replace_char

src/foundation/str_util.c:174–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174char *cbm_str_replace_char(CBMArena *a, const char *s, char from, char to) {
175 if (!s) {
176 return NULL;
177 }
178 size_t len = strlen(s);
179 char *result = (char *)cbm_arena_alloc(a, len + SKIP_ONE);
180 if (!result) {
181 return NULL;
182 }
183 for (size_t i = 0; i < len; i++) {
184 result[i] = (s[i] == from) ? to : s[i];
185 }
186 result[len] = '\0';
187 return result;
188}
189
190char *cbm_str_strip_ext(CBMArena *a, const char *path) {
191 if (!path) {

Callers 1

test_str_util.cFile · 0.85

Calls 1

cbm_arena_allocFunction · 0.70

Tested by

no test coverage detected