mirror of
https://github.com/zebrajr/postgres.git
synced 2025-12-07 12:20:31 +01:00
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
This commit is contained in:
parent
b9def57a3c
commit
6271d9922e
|
|
@ -1109,7 +1109,7 @@ index_seq_search(const char *str, const KeyWord *kw, const int *index)
|
||||||
if (!KeyWord_INDEX_FILTER(*str))
|
if (!KeyWord_INDEX_FILTER(*str))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if ((poz = *(index + (*str - ' '))) > -1)
|
if ((poz = index[*str - ' ']) > -1)
|
||||||
{
|
{
|
||||||
const KeyWord *k = kw + poz;
|
const KeyWord *k = kw + poz;
|
||||||
|
|
||||||
|
|
@ -1531,7 +1531,7 @@ get_th(const char *num, int type)
|
||||||
|
|
||||||
Assert(len > 0);
|
Assert(len > 0);
|
||||||
|
|
||||||
last = *(num + (len - 1));
|
last = num[len - 1];
|
||||||
if (!isdigit((unsigned char) last))
|
if (!isdigit((unsigned char) last))
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||||
|
|
@ -4807,7 +4807,7 @@ static char *
|
||||||
fill_str(char *str, int c, int max)
|
fill_str(char *str, int c, int max)
|
||||||
{
|
{
|
||||||
memset(str, c, max);
|
memset(str, c, max);
|
||||||
*(str + max) = '\0';
|
str[max] = '\0';
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user