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/libhttpd/urlfmt.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
#include <bin.h>
4
#include <httpd.h>
5
 
6
int
7
hurlfmt(Fmt *f)
8
{
9
	char buf[HMaxWord*2];
10
	Rune r;
11
	char *s;
12
	int t;
13
 
14
	s = va_arg(f->args, char*);
15
	for(t = 0; t < sizeof(buf) - 8; ){
16
		s += chartorune(&r, s);
17
		if(r == 0)
18
			break;
19
		if(r <= ' ' || r == '%' || r >= Runeself)
20
			t += snprint(&buf[t], sizeof(buf)-t, "%%%2.2x", r);
21
		else
22
			buf[t++] = r;
23
	}
24
	buf[t] = 0;
25
	return fmtstrcpy(f, buf);
26
}