aboutsummaryrefslogtreecommitdiff
path: root/vendor/librune/lib/builder/u8strpushr.c
blob: 3fe31f2cd9ed23d084e44a86627d25218c349812 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "builder.h"
#include "mbstring.h"

#include "internal/common.h"

struct u8str *
u8strpushr(struct u8str *b, rune ch)
{
	if (!u8strgrow(b, b->len + u8wdth(ch)))
		return nullptr;
	b->len += rtou8(b->p + b->len, ch, b->cap - b->len);
	return b;
}