Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_unix/sys/src/libc/port/utfecpy.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <u.h>
2
#include <libc.h>
3
 
4
char*
5
utfecpy(char *to, char *e, char *from)
6
{
7
	char *end;
8
 
9
	if(to >= e)
10
		return to;
11
	end = memccpy(to, from, '\0', e - to);
12
	if(end == nil){
13
		end = e;
14
		while(end>to && (*--end&0xC0)==0x80)
15
			;
16
		*end = '\0';
17
	}else{
18
		end--;
19
	}
20
	return end;
21
}