aboutsummaryrefslogtreecommitdiff
path: root/vendor/librune/lib/builder/u8strpushstr.c
blob: 8329c816d78396b85313b4b810acdefbd717c82c (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 "mbstring.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;
}