]> git.saurik.com Git - minimal.git/blob - string.h
c3a972437c4610a82e9ed899cf2e7964db404cb0
[minimal.git] / string.h
1 char *strndup_(const char *src, int len) {
2 char *dst = malloc(len + 1);
3 _assert(dst != NULL);
4 strncpy(dst, src, len);
5 dst[len] = '\0';
6 return dst;
7 }