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_fixcpp/sys/src/libString/s_memappend.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 "String.h"
4
 
5
/* append a char array ( of up to n characters) to a String */
6
String *
7
s_memappend(String *to, char *from, int n)
8
{
9
	char *e;
10
 
11
	if (to == 0)
12
		to = s_new();
13
	if (from == 0)
14
		return to;
15
	for(e = from + n; from < e; from++)
16
		s_putc(to, *from);
17
	s_terminate(to);
18
	return to;
19
}
20