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:07:27 +0000 (08:07 +0900)
src/parser/outfuncs.c

index c860eb6a6f0ce1599a942a1fd001021dbcc0b4ed..2c5e3da80c8485495cf19fc22cc12b8bca5469dd 100644 (file)
@@ -4755,7 +4755,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)
@@ -4763,14 +4762,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 ");
@@ -4789,7 +4786,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);
                }
        }