summaryrefslogtreecommitdiff
path: root/src/port
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2022-07-16 08:42:15 +0200
committerPeter Eisentraut <peter@eisentraut.org>2022-07-16 08:50:49 +0200
commit9fd45870c1436b477264c0c82eb195df52bc0919 (patch)
tree10a09724c0bcffa8f58f262e50c3260cde484446 /src/port
parentc94ae9d827a360d74da6a304692d34a4dc8b6445 (diff)
downloadpostgresql-9fd45870c1436b477264c0c82eb195df52bc0919.tar.gz
Replace many MemSet calls with struct initialization
This replaces all MemSet() calls with struct initialization where that is easily and obviously possible. (For example, some cases have to worry about padding bits, so I left those.) (The same could be done with appropriate memset() calls, but this patch is part of an effort to phase out MemSet(), so it doesn't touch memset() calls.) Reviewed-by: Ranier Vilela <ranier.vf@gmail.com> Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org> Discussion: https://www.postgresql.org/message-id/9847b13c-b785-f4e2-75c3-12ec77a3b05c@enterprisedb.com
Diffstat (limited to 'src/port')
-rw-r--r--src/port/snprintf.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/port/snprintf.c b/src/port/snprintf.c
index abb1c59770..e037cf0a88 100644
--- a/src/port/snprintf.c
+++ b/src/port/snprintf.c
@@ -756,12 +756,8 @@ find_arguments(const char *format, va_list args,
int longflag;
int fmtpos;
int i;
- int last_dollar;
- PrintfArgType argtypes[PG_NL_ARGMAX + 1];
-
- /* Initialize to "no dollar arguments known" */
- last_dollar = 0;
- MemSet(argtypes, 0, sizeof(argtypes));
+ int last_dollar = 0; /* Init to "no dollar arguments known" */
+ PrintfArgType argtypes[PG_NL_ARGMAX + 1] = {0};
/*
* This loop must accept the same format strings as the one in dopr().