mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-31 13:00:49 +00:00
Introduce mg_calloc
This commit is contained in:
1 parent
5f1f4a0df8
commit
074ef5197b
26 files changed
+259
-313
No files matched your search
@@ -26,7 +26,7 @@ int mg_casecmp(const char *s1, const char *s2) {
|
||||
struct mg_str mg_strdup(const struct mg_str s) {
|
||||
struct mg_str r = {NULL, 0};
|
||||
if (s.len > 0 && s.buf != NULL) {
|
||||
char *sc = (char *) calloc(1, s.len + 1);
|
||||
char *sc = (char *) mg_calloc(1, s.len + 1);
|
||||
if (sc != NULL) {
|
||||
memcpy(sc, s.buf, s.len);
|
||||
sc[s.len] = '\0';
|
||||
|
||||
Reference in new issue
Block a user