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_tlsv12/sys/src/libc/port/utflen.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
int
5
utflen(char *s)
6
{
7
	int c;
8
	long n;
9
	Rune rune;
10
 
11
	n = 0;
12
	for(;;) {
13
		c = *(uchar*)s;
14
		if(c < Runeself) {
15
			if(c == 0)
16
				return n;
17
			s++;
18
		} else
19
			s += chartorune(&rune, s);
20
		n++;
21
	}
22
}