xref: /plan9-contrib/sys/src/ape/lib/ap/gen/strxfrm.c (revision 219b2ee8daee37f4aad58d63f21287faa8e4ffdc)
1 #include <string.h>
2 
3 size_t
4 strxfrm(char *s1, const char *s2, size_t n)
5 {
6 	/*
7 	 * BUG: supposed to transform s2 to a canonical form
8 	 * so that strcmp can be used instead of strcoll, but
9 	 * our strcoll just uses strcmp.
10 	 */
11 
12 	size_t xn = strlen(s2);
13 	memcpy(s1, s2, xn>n? n : xn);
14 	return xn;
15 }
16