summaryrefslogtreecommitdiff
path: root/sys/src/ape/lib/ap/gen/strxfrm.c
blob: ecb09506476f6a57af5daa92adff2982fa62fae8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <string.h>

size_t
strxfrm(char *s1, const char *s2, size_t n)
{
	/*
	 * BUG: supposed to transform s2 to a canonical form
	 * so that strcmp can be used instead of strcoll, but
	 * our strcoll just uses strcmp.
	 */

	size_t xn = strlen(s2);
	if(n > xn)
		n = xn;
	memcpy(s1, s2, n);
	return xn;
}