myMPD
Internal API documentation
Loading...
Searching...
No Matches
mem.c File Reference

Memory allocation related functions. More...

#include "src/lib/mem.h"
#include <string.h>
Include dependency graph for mem.c:

Functions

char * my_strdup (const char *str, size_t len)

Detailed Description

Memory allocation related functions.

Function Documentation

◆ my_strdup()

char * my_strdup ( const char * str,
size_t len )

Duplicate a string and enforces NULL-termination Aborts on malloc failure

Parameters
strString to copy
lenLength of string to copy
Returns
NULL-terminated copy of str