Skip to content

Commit beef895

Browse files
committed
Suppress possibly-uninitialized-variable warning seen with older gcc versions.
1 parent 890a999 commit beef895

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/postmaster/pgstat.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2490,7 +2490,7 @@ pgstat_report_activity(BackendState state, const char *cmd_str)
24902490
volatile PgBackendStatus *beentry = MyBEEntry;
24912491
TimestampTz start_timestamp;
24922492
TimestampTz current_timestamp;
2493-
int len;
2493+
int len = 0;
24942494

24952495
TRACE_POSTGRESQL_STATEMENT_STATUS(cmd_str);
24962496

@@ -2524,8 +2524,8 @@ pgstat_report_activity(BackendState state, const char *cmd_str)
25242524
start_timestamp = GetCurrentStatementStartTimestamp();
25252525
if (cmd_str != NULL)
25262526
{
2527-
len = strlen(cmd_str);
2528-
len = pg_mbcliplen(cmd_str, len, pgstat_track_activity_query_size - 1);
2527+
len = pg_mbcliplen(cmd_str, strlen(cmd_str),
2528+
pgstat_track_activity_query_size - 1);
25292529
}
25302530

25312531
/*

0 commit comments

Comments
 (0)