From f791aa01fad7e81223808584212c6a1a4c80ca07 Mon Sep 17 00:00:00 2001 From: pommicket Date: Mon, 2 Jan 2023 14:10:38 -0500 Subject: finish restructuring --- lsp-json.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lsp-json.c') diff --git a/lsp-json.c b/lsp-json.c index 4d5a2c7..94bb556 100644 --- a/lsp-json.c +++ b/lsp-json.c @@ -4,7 +4,8 @@ #define LSP_INTERNAL 1 #include "lsp.h" - +#include "util.h" +#include "unicode.h" #define SKIP_WHITESPACE while (json_is_space(text[index])) ++index; @@ -587,8 +588,7 @@ void json_string_get(const JSON *json, JSONString string, char *buf, size_t buf_ *buf = '\0'; } -// returns a malloc'd null-terminated string. -static char *json_string_get_alloc(const JSON *json, JSONString string) { +char *json_string_get_alloc(const JSON *json, JSONString string) { u32 n = string.len + 1; if (n == 0) --n; // extreme edge case char *buf = calloc(1, n); -- cgit v1.2.3