diff options
author | Preston Pan <preston@nullring.xyz> | 2023-01-08 14:44:25 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2023-01-08 14:44:25 -0800 |
commit | 87d82ead963c24d84a4f6e417b96b9bf73d132bb (patch) | |
tree | 096e60118f6e62508db653d5102d85e77b8d73e9 /src/macros.c | |
parent | aa1dd020edb82f26dd5bc29378177cfcaa4c53ed (diff) |
fix memory problem
Diffstat (limited to 'src/macros.c')
-rw-r--r-- | src/macros.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/macros.c b/src/macros.c index 1effefe..1643168 100644 --- a/src/macros.c +++ b/src/macros.c @@ -8,3 +8,10 @@ void die(char *message) { fprintf(stderr, "%sFATAL ERROR: %s%s\n", RED, message, reset); exit(EXIT_FAILURE); } + +char *char_to_string(char c) { + char *s = malloc(2); + s[0] = c; + s[1] = '\0'; + return s; +} |