From beef89567e3a0e3e1c753754a474065c5ad632fe Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 24 Jan 2012 13:40:26 -0500 Subject: [PATCH] Suppress possibly-uninitialized-variable warning seen with older gcc versions. --- src/backend/postmaster/pgstat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index 3ab8dfe065..e5bafd3c2d 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -2490,7 +2490,7 @@ pgstat_report_activity(BackendState state, const char *cmd_str) volatile PgBackendStatus *beentry = MyBEEntry; TimestampTz start_timestamp; TimestampTz current_timestamp; - int len; + int len = 0; TRACE_POSTGRESQL_STATEMENT_STATUS(cmd_str); @@ -2524,8 +2524,8 @@ pgstat_report_activity(BackendState state, const char *cmd_str) start_timestamp = GetCurrentStatementStartTimestamp(); if (cmd_str != NULL) { - len = strlen(cmd_str); - len = pg_mbcliplen(cmd_str, len, pgstat_track_activity_query_size - 1); + len = pg_mbcliplen(cmd_str, strlen(cmd_str), + pgstat_track_activity_query_size - 1); } /* -- 2.40.0