From 802907b377169917f4bf16c02c3ae455e2bae7cd Mon Sep 17 00:00:00 2001 From: Vaibhav Agarwal <62557502+vaibhav412@users.noreply.github.com> Date: Tue, 24 Oct 2023 23:58:38 +0530 Subject: [PATCH] Update functions.c --- contrib/babelfishpg_tsql/runtime/functions.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/babelfishpg_tsql/runtime/functions.c b/contrib/babelfishpg_tsql/runtime/functions.c index 95908f928f8..9ecf02ea6df 100644 --- a/contrib/babelfishpg_tsql/runtime/functions.c +++ b/contrib/babelfishpg_tsql/runtime/functions.c @@ -1750,7 +1750,7 @@ type_id(PG_FUNCTION_ARGS) char **splitted_object_name; Oid schema_oid; Oid user_id = GetUserId(); - Oid result = InvalidOid; + Oid result = InvalidOid; int i; if (PG_ARGISNULL(0)) @@ -1760,9 +1760,9 @@ type_id(PG_FUNCTION_ARGS) /* strip trailing whitespace from input */ i = pg_mbstrlen(input); while (i > 0 && isspace((unsigned char) input[i - 1])) - i--; - if(i < pg_mbstrlen(input)) - input[i] = '\0'; + i--; + if(i < pg_mbstrlen(input)) + input[i] = '\0'; /* length should be restricted to 4000 */ if (i > TYPE_NAME_MAX_LENGTH) @@ -1776,7 +1776,7 @@ type_id(PG_FUNCTION_ARGS) if(pg_mbstrlen(splitted_object_name[1]) != 0) { pfree(input); - for (int i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) pfree(splitted_object_name[i]); pfree(splitted_object_name); PG_RETURN_NULL();