aboutsummaryrefslogtreecommitdiff
path: root/vendor/librune/lib/builder/u8strpushstr.c
blob: b80ad35fa49dd21c85bbab32ef2eaa89749d9ac3 (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 u8buf *
u8strpushstr(struct u8buf *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;
}