summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/formatting.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-10-29 09:27:59 +0100
committerPeter Eisentraut <peter@eisentraut.org>2025-10-29 09:28:55 +0100
commit6271d9922e040e457b58eedcfa60839146951243 (patch)
tree6b425ecdf6b12c40f83db56b0f0a4df54c9018b3 /src/backend/utils/adt/formatting.c
parentb9def57a3c95540737290ca88eadf33212785690 (diff)
formatting.c cleanup: Use array syntax instead of pointer arithmetic
for easier readability Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/6dd9d208-a3ed-49b5-b03d-8617261da973%40eisentraut.org
Diffstat (limited to 'src/backend/utils/adt/formatting.c')
-rw-r--r--src/backend/utils/adt/formatting.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
index a94e00eaa0d..cda7b2cb37c 100644
--- a/src/backend/utils/adt/formatting.c
+++ b/src/backend/utils/adt/formatting.c
@@ -1109,7 +1109,7 @@ index_seq_search(const char *str, const KeyWord *kw, const int *index)
if (!KeyWord_INDEX_FILTER(*str))
return NULL;
- if ((poz = *(index + (*str - ' '))) > -1)
+ if ((poz = index[*str - ' ']) > -1)
{
const KeyWord *k = kw + poz;
@@ -1531,7 +1531,7 @@ get_th(const char *num, int type)
Assert(len > 0);
- last = *(num + (len - 1));
+ last = num[len - 1];
if (!isdigit((unsigned char) last))
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
@@ -4807,7 +4807,7 @@ static char *
fill_str(char *str, int c, int max)
{
memset(str, c, max);
- *(str + max) = '\0';
+ str[max] = '\0';
return str;
}