Skip to content

Commit 489e6ac

Browse files
committed
Fix comparison of an array of characters with zero to compare with '\0' instead.
Report from Andres Freund.
1 parent c1fe08e commit 489e6ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/pgstatfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,7 @@ pg_stat_get_archiver(PG_FUNCTION_ARGS)
17511751

17521752
/* Fill values and NULLs */
17531753
values[0] = Int64GetDatum(archiver_stats->archived_count);
1754-
if (archiver_stats->last_archived_wal == 0)
1754+
if (*(archiver_stats->last_archived_wal) == '\0')
17551755
nulls[1] = true;
17561756
else
17571757
values[1] = CStringGetTextDatum(archiver_stats->last_archived_wal);
@@ -1762,7 +1762,7 @@ pg_stat_get_archiver(PG_FUNCTION_ARGS)
17621762
values[2] = TimestampTzGetDatum(archiver_stats->last_archived_timestamp);
17631763

17641764
values[3] = Int64GetDatum(archiver_stats->failed_count);
1765-
if (archiver_stats->last_failed_wal == 0)
1765+
if (*(archiver_stats->last_failed_wal) == '\0')
17661766
nulls[4] = true;
17671767
else
17681768
values[4] = CStringGetTextDatum(archiver_stats->last_failed_wal);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy