MCPcopy Create free account
hub / github.com/antirez/ds4 / agent_input_buf_append

Function agent_input_buf_append

ds4_agent.c:392–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390
391static char *xstrdup(const char *s) {
392 if (!s) s = "";
393 size_t n = strlen(s);
394 char *p = xmalloc(n + 1);
395 memcpy(p, s, n + 1);
396 return p;
397}
398
399static char *xstrndup(const char *s, size_t n) {
400 char *p = xmalloc(n + 1);
401 memcpy(p, s, n);
402 p[n] = '\0';
403 return p;
404}
405
406static void *xrealloc(void *ptr, size_t n) {

Callers 1

Calls 1

xreallocFunction · 0.70

Tested by

no test coverage detected