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/cmd/unix/drawterm/libc/sprint.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 "fmtdef.h"
4
 
5
int
6
sprint(char *buf, char *fmt, ...)
7
{
8
	int n;
9
	uint len;
10
	va_list args;
11
 
12
	len = 1<<30;  /* big number, but sprint is deprecated anyway */
13
	/*
14
	 * on PowerPC, the stack is near the top of memory, so
15
	 * we must be sure not to overflow a 32-bit pointer.
16
	 */
17
	if((uintptr)buf+len < (uintptr)buf)
18
		len = -(uintptr)buf-1;
19
 
20
	va_start(args, fmt);
21
	n = vsnprint(buf, len, fmt, args);
22
	va_end(args);
23
	return n;
24
}