aboutsummaryrefslogtreecommitdiff
path: root/vendor/librune/lib/builder/u8strpushstr.c
blob: a036840bbb18f14e4f58f9582d215a8c6d2c9a92 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <string.h>

#include "builder.h"
#include "utf8.h"

#include "internal/common.h"

struct u8str *
u8strpushstr(struct u8str *b, const char *s)
{
	size_t n = strlen(s);
	if (!u8strgrow(b, b->len + n))
		return nullptr;
	memcpy(b->p + b->len, s, n);
	b->len += n;
	return b;
}