Fix compiler warnings.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 17 Sep 2019 23:07:27 +0000 (08:07 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 17 Sep 2019 23:08:02 +0000 (08:08 +0900)
src/parser/outfuncs.c

index 92cd1319f564c503d414b6c1f34efdf6a3439cbd..24ed4b35f71d0836feffc1391482f16605689ce1 100644 (file)
@@ -4751,7 +4751,6 @@ _outCreatedbOptList(String *str, List *options)
        {
                DefElem *e = lfirst(lc);
                Value *v = (Value *) e->arg;
-               int sconst = false;
 
                /* keyword */
                if (strcmp(e->defname, "template") == 0)
@@ -4759,14 +4758,12 @@ _outCreatedbOptList(String *str, List *options)
                else if (strcmp(e->defname, "location") == 0)
                {
                        string_append_char(str, " LOCATION ");
-                       sconst = true;
                }
                else if (strcmp(e->defname, "tablespace") == 0)
                        string_append_char(str, " TABLESPACE ");
                else if (strcmp(e->defname, "encoding") == 0)
                {
                        string_append_char(str, " ENCODING ");
-                       sconst = true;
                }
                else if (strcmp(e->defname, "owner") == 0)
                        string_append_char(str, " OWNER ");
@@ -4785,7 +4782,7 @@ _outCreatedbOptList(String *str, List *options)
                else
                {
                        char buf[16];
-                       snprintf(buf, 16, "%ld", v->val.ival);
+                       snprintf(buf, sizeof(buf), "%ld", v->val.ival);
                        string_append_char(str, buf);
                }
        }