summaryrefslogtreecommitdiff
path: root/contrib/pg_upgrade/info.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-05-14 00:32:21 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-05-14 00:32:21 +0000
commit8eac39780d5bfab5f51274081094e1913ecf4722 (patch)
tree208639581b3323e9ec9da3aec6679fac0ca073dc /contrib/pg_upgrade/info.c
parentadf6b8edfbc4a286ac779261685c36f42b664325 (diff)
Get rid of unsafe sprintf and snprintf usages. Per compiler warnings.
Diffstat (limited to 'contrib/pg_upgrade/info.c')
-rw-r--r--contrib/pg_upgrade/info.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/pg_upgrade/info.c b/contrib/pg_upgrade/info.c
index 2b0bba6170b..75a29e3d8f6 100644
--- a/contrib/pg_upgrade/info.c
+++ b/contrib/pg_upgrade/info.c
@@ -362,10 +362,10 @@ get_rel_infos(migratorContext *ctx, const DbInfo *dbinfo,
curr->reloid = atol(PQgetvalue(res, relnum, i_oid));
nspname = PQgetvalue(res, relnum, i_nspname);
- snprintf(curr->nspname, sizeof(curr->nspname), nspname);
+ strlcpy(curr->nspname, nspname, sizeof(curr->nspname));
relname = PQgetvalue(res, relnum, i_relname);
- snprintf(curr->relname, sizeof(curr->relname), relname);
+ strlcpy(curr->relname, relname, sizeof(curr->relname));
curr->relfilenode = atol(PQgetvalue(res, relnum, i_relfilenode));
curr->toastrelid = atol(PQgetvalue(res, relnum, i_reltoastrelid));
@@ -374,7 +374,7 @@ get_rel_infos(migratorContext *ctx, const DbInfo *dbinfo,
/* if no table tablespace, use the database tablespace */
if (strlen(tblspace) == 0)
tblspace = dbinfo->db_tblspace;
- snprintf(curr->tablespace, sizeof(curr->tablespace), "%s", tblspace);
+ strlcpy(curr->tablespace, tblspace, sizeof(curr->tablespace));
}
PQclear(res);