From 71a52953717371f8fa77e50f966410ac16581852 Mon Sep 17 00:00:00 2001
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Date: Wed, 10 Aug 2022 14:21:47 +0900
Subject: [PATCH 3/3] Use ternary value against ternary variables

createuser.c uses '0' against a trivalue.  It should use TRI_DEFAULT
instead.
---
 src/bin/scripts/createuser.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/bin/scripts/createuser.c b/src/bin/scripts/createuser.c
index 9789bab034..4a2a751f7e 100644
--- a/src/bin/scripts/createuser.c
+++ b/src/bin/scripts/createuser.c
@@ -239,7 +239,7 @@ main(int argc, char *argv[])
 		free(pw2);
 	}
 
-	if (superuser == 0)
+	if (superuser == TRI_DEFAULT)
 	{
 		if (interactive && yesno_prompt("Shall the new role be a superuser?"))
 			superuser = TRI_YES;
@@ -254,7 +254,7 @@ main(int argc, char *argv[])
 		createrole = TRI_YES;
 	}
 
-	if (createdb == 0)
+	if (createdb == TRI_DEFAULT)
 	{
 		if (interactive && yesno_prompt("Shall the new role be allowed to create databases?"))
 			createdb = TRI_YES;
@@ -262,7 +262,7 @@ main(int argc, char *argv[])
 			createdb = TRI_NO;
 	}
 
-	if (createrole == 0)
+	if (createrole == TRI_DEFAULT)
 	{
 		if (interactive && yesno_prompt("Shall the new role be allowed to create more new roles?"))
 			createrole = TRI_YES;
@@ -270,7 +270,7 @@ main(int argc, char *argv[])
 			createrole = TRI_NO;
 	}
 
-	if (bypassrls == 0)
+	if (bypassrls == TRI_DEFAULT)
 	{
 		if (interactive && yesno_prompt("Shall the new role be allowed to bypass row-level security policy?"))
 			bypassrls = TRI_YES;
@@ -278,13 +278,13 @@ main(int argc, char *argv[])
 			bypassrls = TRI_NO;
 	}
 
-	if (replication == 0)
+	if (replication == TRI_DEFAULT)
 		replication = TRI_NO;
 
-	if (inherit == 0)
+	if (inherit == TRI_DEFAULT)
 		inherit = TRI_YES;
 
-	if (login == 0)
+	if (login == TRI_DEFAULT)
 		login = TRI_YES;
 
 	cparams.dbname = NULL;		/* this program lacks any dbname option... */
-- 
2.31.1

