From 569d160367f8db13c3092daa70a684e8953d23dd Mon Sep 17 00:00:00 2001 From: Lukas Fittl Date: Sun, 31 Dec 2023 11:50:53 -0800 Subject: [PATCH] WIP --- src/pg_query_parse_plpgsql.c | 2 +- src/postgres/src_port_strlcpy.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pg_query_parse_plpgsql.c b/src/pg_query_parse_plpgsql.c index 8fc79988..99c09d2a 100644 --- a/src/pg_query_parse_plpgsql.c +++ b/src/pg_query_parse_plpgsql.c @@ -492,7 +492,7 @@ PgQueryPlpgsqlParseResult pg_query_parse_plpgsql(const char* input) plpgsql_free_function_memory(func_and_error.func); new_out_len = strlen(result.plpgsql_funcs) + strlen(func_json) + 3; - new_out = malloc(new_out_len * sizeof(char)); + new_out = malloc(new_out_len); int n = snprintf(new_out, new_out_len, "%s%s,\n", result.plpgsql_funcs, func_json); if (n < 0 || n >= new_out_len) { PgQueryError* error = malloc(sizeof(PgQueryError)); diff --git a/src/postgres/src_port_strlcpy.c b/src/postgres/src_port_strlcpy.c index 71b794e9..6b5efd35 100644 --- a/src/postgres/src_port_strlcpy.c +++ b/src/postgres/src_port_strlcpy.c @@ -34,6 +34,7 @@ #include "c.h" +#ifdef WIN32 /* * Copy src to string dst of size siz. At most siz-1 characters @@ -69,3 +70,5 @@ strlcpy(char *dst, const char *src, size_t siz) return (s - src - 1); /* count does not include NUL */ } + +#endif