From 8a573504448c9697d4b85303fa92b93f5444cf85 Mon Sep 17 00:00:00 2001 From: Lukas Fittl Date: Sun, 31 Dec 2023 06:47:31 +0000 Subject: [PATCH] WIP --- src/pg_query_parse_plpgsql.c | 2 +- src/postgres/include/port/win32_port.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pg_query_parse_plpgsql.c b/src/pg_query_parse_plpgsql.c index c58af859..8fc79988 100644 --- a/src/pg_query_parse_plpgsql.c +++ b/src/pg_query_parse_plpgsql.c @@ -491,7 +491,7 @@ PgQueryPlpgsqlParseResult pg_query_parse_plpgsql(const char* input) func_json = plpgsqlToJSON(func_and_error.func); plpgsql_free_function_memory(func_and_error.func); - new_out_len = strlen(result.plpgsql_funcs) + strlen(func_json) + 2; + new_out_len = strlen(result.plpgsql_funcs) + strlen(func_json) + 3; new_out = malloc(new_out_len * sizeof(char)); int n = snprintf(new_out, new_out_len, "%s%s,\n", result.plpgsql_funcs, func_json); if (n < 0 || n >= new_out_len) { diff --git a/src/postgres/include/port/win32_port.h b/src/postgres/include/port/win32_port.h index b957d5c5..954e272b 100644 --- a/src/postgres/include/port/win32_port.h +++ b/src/postgres/include/port/win32_port.h @@ -63,6 +63,8 @@ #include #include +#undef ERROR + #undef small #include #include