mailing list of musl libc
 help / color / mirror / code / Atom feed
617d27ba9e65ba384fa97433e90b1632015ee998 blob 197 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 
#include <stdlib.h>
#include <string.h>

char *strndup(const char *s, size_t n)
{
	size_t l = strnlen(s, n);
	char *d = malloc(l+1);
	if (!d) return NULL;
	memcpy(d, s, l);
	d[l] = 0;
	return d;
}
debug log:

solving 617d27b ...
found 617d27b in https://git.vuxu.org/mirror/musl/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).