MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / my_strndup

Function my_strndup

test/test.c:2027–2035  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2025
2026#if defined( __MINGW32__ )
2027static char * my_strndup(const char *src, int len)
2028{
2029 int src_len = strlen(src);
2030 int alloc = src_len < len ? src_len + 1 : len + 1;
2031 char *result = malloc(alloc);
2032 strncpy(result, src, alloc - 1);
2033 result[alloc - 1] = 0;
2034 return result;
2035}
2036#else
2037#define my_strndup strndup
2038#endif

Callers 1

str_width_splitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected