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

index 8df29cb36a9e1d31d3ca88aef4b614137dfffba8..bb78b5ee8c40958d1bb00e0f4c9c119edc0758a1 100644 (file)
@@ -4879,7 +4879,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)
@@ -4887,14 +4886,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 ");
@@ -4914,7 +4911,7 @@ _outCreatedbOptList(String * str, List *options)
                {
                        char            buf[16];
 
-                       snprintf(buf, 16, "%d", v->val.ival);
+                       snprintf(buf, sizeof(buf), "%d", v->val.ival);
                        string_append_char(str, buf);
                }
        }