From f4482a542c30034c7871fd35050128823ef5c6d5 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 21 Nov 2013 21:46:43 -0500 Subject: [PATCH] Tweak streamutil.c further to avoid scan-build warning The previous change added a new scan-build warning about need_password assigned but not read. --- src/bin/pg_basebackup/streamutil.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c index 67917512e2..6cc6cd200e 100644 --- a/src/bin/pg_basebackup/streamutil.c +++ b/src/bin/pg_basebackup/streamutil.c @@ -117,7 +117,7 @@ GetConnection(void) /* If -W was given, force prompt for password, but only the first time */ need_password = (dbgetpassword == 1 && dbpassword == NULL); - while (true) + do { /* Get a new password if appropriate */ if (need_password) @@ -161,9 +161,8 @@ GetConnection(void) PQfinish(tmpconn); need_password = true; } - else - break; } + while (need_password); if (PQstatus(tmpconn) != CONNECTION_OK) { -- 2.40.0