aboutsummaryrefslogtreecommitdiff
path: root/vendor/librune/lib/builder/u8strpushu8.c
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/librune/lib/builder/u8strpushu8.c')
-rw-r--r--vendor/librune/lib/builder/u8strpushu8.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/vendor/librune/lib/builder/u8strpushu8.c b/vendor/librune/lib/builder/u8strpushu8.c
new file mode 100644
index 0000000..0bcf9fc
--- /dev/null
+++ b/vendor/librune/lib/builder/u8strpushu8.c
@@ -0,0 +1,16 @@
+#include <string.h>
+
+#include "builder.h"
+#include "utf8.h"
+
+#include "internal/common.h"
+
+struct u8buf *
+u8strpushu8(struct u8buf *b, struct u8view v)
+{
+ if (!u8strgrow(b, b->len + v.len))
+ return nullptr;
+ memcpy(b->p + b->len, v.p, v.len);
+ b->len += v.len;
+ return b;
+}