aboutsummaryrefslogtreecommitdiff
path: root/vendor/librune/lib/builder/u8strpushstr.c
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-01-23 16:06:31 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-01-23 16:06:31 +0100
commit0a9060e335d59f0ccaf5d9600abbcb938db30928 (patch)
tree874deccfe6c9b5a0d225cd892b06229378761b2f /vendor/librune/lib/builder/u8strpushstr.c
parent851ca8da9d72fbc438420eab4a7de4d84fb5bc5d (diff)
Bump librune version
Diffstat (limited to 'vendor/librune/lib/builder/u8strpushstr.c')
-rw-r--r--vendor/librune/lib/builder/u8strpushstr.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/librune/lib/builder/u8strpushstr.c b/vendor/librune/lib/builder/u8strpushstr.c
new file mode 100644
index 0000000..b80ad35
--- /dev/null
+++ b/vendor/librune/lib/builder/u8strpushstr.c
@@ -0,0 +1,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;
+}