mailing list of musl libc
 help / color / mirror / code / Atom feed
6eaa40787307da8eb1b89c28ecd657377cf2742e blob 397 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 
#include <string.h>

#define weak_alias(o, n) extern __typeof__(o) n __attribute__((weak, alias(#o)))

size_t __strscpy(char *, const char *, size_t);

char *__stpncpy(char *restrict d, const char *restrict s, size_t n)
{
	if (!n) return d;

	size_t r = __strscpy(d, s, n) + 1;

	if (s[r - 1]) d[r - 1] = s[r - 1];
	else memset(d + r, 0, n - r);

	return d + r;
}

weak_alias(__stpncpy, stpncpy);
debug log:

solving 6eaa4078 ...
found 6eaa4078 in https://inbox.vuxu.org/musl/20170715195541.3136-4-nwmcsween@gmail.com/
found 0b37da5d in https://inbox.vuxu.org/musl/20170715195541.3136-3-nwmcsween@gmail.com/
found 1f57a4dd in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 1f57a4ddbd0a818168e56c0b15178e93304c42cf	src/string/stpncpy.c

applying [1/2] https://inbox.vuxu.org/musl/20170715195541.3136-3-nwmcsween@gmail.com/
diff --git a/src/string/stpncpy.c b/src/string/stpncpy.c
index 1f57a4dd..0b37da5d 100644


applying [2/2] https://inbox.vuxu.org/musl/20170715195541.3136-4-nwmcsween@gmail.com/
diff --git a/src/string/stpncpy.c b/src/string/stpncpy.c
index 0b37da5d..6eaa4078 100644

Checking patch src/string/stpncpy.c...
Applied patch src/string/stpncpy.c cleanly.
Checking patch src/string/stpncpy.c...
Applied patch src/string/stpncpy.c cleanly.

index at:
100644 6eaa40787307da8eb1b89c28ecd657377cf2742e	src/string/stpncpy.c

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).