diff --git a/contrib/pg_standby/pg_standby.c b/contrib/pg_standby/pg_standby.c index eab5e0bd226..8be544bf70d 100644 --- a/contrib/pg_standby/pg_standby.c +++ b/contrib/pg_standby/pg_standby.c @@ -358,7 +358,7 @@ SetWALFileNameForCleanup(void) if (keepfiles > 0) { sscanf(nextWALFileName, "%08X%08X%08X", &tli, &log, &seg); - if (tli > 0 && log >= 0 && seg > 0) + if (tli > 0 && seg > 0) { log_diff = keepfiles / MaxSegmentsPerLogFile; seg_diff = keepfiles % MaxSegmentsPerLogFile; diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c index a5ea452d8d7..6be86dcf695 100644 --- a/src/interfaces/libpq/fe-exec.c +++ b/src/interfaces/libpq/fe-exec.c @@ -2897,7 +2897,7 @@ PQoidStatus(const PGresult *res) size_t len; - if (!res || !res->cmdStatus || strncmp(res->cmdStatus, "INSERT ", 7) != 0) + if (!res || strncmp(res->cmdStatus, "INSERT ", 7) != 0) return ""; len = strspn(res->cmdStatus + 7, "0123456789"); @@ -2921,7 +2921,6 @@ PQoidValue(const PGresult *res) unsigned long result; if (!res || - !res->cmdStatus || strncmp(res->cmdStatus, "INSERT ", 7) != 0 || res->cmdStatus[7] < '0' || res->cmdStatus[7] > '9')