diff options
Diffstat (limited to 'vendor/librune/lib/builder/u8strinit.c')
-rw-r--r-- | vendor/librune/lib/builder/u8strinit.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/librune/lib/builder/u8strinit.c b/vendor/librune/lib/builder/u8strinit.c new file mode 100644 index 0000000..caf061e --- /dev/null +++ b/vendor/librune/lib/builder/u8strinit.c @@ -0,0 +1,17 @@ +#include <stdlib.h> + +#include "builder.h" + +#include "internal/common.h" + +struct u8buf * +u8strinit(struct u8buf *b, size_t n) +{ + if (n && !(b->p = malloc(n))) + return nullptr; + else + b->p = nullptr; + b->len = 0; + b->cap = n; + return b; +} |