aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/pgstatfuncs.c
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2014-02-04 10:59:39 +0900
committerFujii Masao <fujii@postgresql.org>2014-02-04 10:59:39 +0900
commit489e6ac5a1a4ca7e4ca7683a86ccd8a5d5e3eb59 (patch)
treec6dc80ab15fa71a839781aa09f83b742cc64cd68 /src/backend/utils/adt/pgstatfuncs.c
parentc1fe08eb2f74d2a84e9dd48d54aa836ab74b3f94 (diff)
downloadpostgresql-489e6ac5a1a4ca7e4ca7683a86ccd8a5d5e3eb59.tar.gz
postgresql-489e6ac5a1a4ca7e4ca7683a86ccd8a5d5e3eb59.zip
Fix comparison of an array of characters with zero to compare with '\0' instead.
Report from Andres Freund.
Diffstat (limited to 'src/backend/utils/adt/pgstatfuncs.c')
-rw-r--r--src/backend/utils/adt/pgstatfuncs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c
index 29fc134858b..a4f31cfc7fc 100644
--- a/src/backend/utils/adt/pgstatfuncs.c
+++ b/src/backend/utils/adt/pgstatfuncs.c
@@ -1751,7 +1751,7 @@ pg_stat_get_archiver(PG_FUNCTION_ARGS)
/* Fill values and NULLs */
values[0] = Int64GetDatum(archiver_stats->archived_count);
- if (archiver_stats->last_archived_wal == 0)
+ if (*(archiver_stats->last_archived_wal) == '\0')
nulls[1] = true;
else
values[1] = CStringGetTextDatum(archiver_stats->last_archived_wal);
@@ -1762,7 +1762,7 @@ pg_stat_get_archiver(PG_FUNCTION_ARGS)
values[2] = TimestampTzGetDatum(archiver_stats->last_archived_timestamp);
values[3] = Int64GetDatum(archiver_stats->failed_count);
- if (archiver_stats->last_failed_wal == 0)
+ if (*(archiver_stats->last_failed_wal) == '\0')
nulls[4] = true;
else
values[4] = CStringGetTextDatum(archiver_stats->last_failed_wal);