diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-21 21:48:53 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-21 21:48:53 -0400 |
| commit | 5ee185a4896e43c67b6d299becfa616da78fb9f4 (patch) | |
| tree | 183ceef2fd21230c89334d7d039255d1c86c5dca /stdlib/util.c | |
| parent | f4aaf7b73481248f6768302be688700a364a1af8 (diff) | |
Move stdlib into src/
Diffstat (limited to 'stdlib/util.c')
| -rw-r--r-- | stdlib/util.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/stdlib/util.c b/stdlib/util.c deleted file mode 100644 index 1fe33dfa..00000000 --- a/stdlib/util.c +++ /dev/null @@ -1,26 +0,0 @@ -// Built-in utility functions -#include <ctype.h> -#include <gc.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "text.h" -#include "util.h" - -__attribute__((format(printf, 1, 2))) -public char *heap_strf(const char *fmt, ...) -{ - va_list args; - va_start(args, fmt); - char *tmp = NULL; - int len = vasprintf(&tmp, fmt, args); - if (len < 0) return NULL; - va_end(args); - char *ret = GC_strndup(tmp, (size_t)len); - free(tmp); - return ret; -} - -// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 |
