diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pg_dump/pg_restore.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c index c42e34b8a40..b3dbde0d044 100644 --- a/src/bin/pg_dump/pg_restore.c +++ b/src/bin/pg_dump/pg_restore.c @@ -1052,14 +1052,14 @@ get_dbname_oid_list_from_mfile(const char *dumpdirpath, SimpleOidStringList *dbn { Oid db_oid = InvalidOid; char db_oid_str[MAXPGPATH + 1] = ""; - char dbname[MAXPGPATH + 1] = ""; + char *dbname; /* Extract dboid. */ sscanf(line, "%u", &db_oid); sscanf(line, "%20s", db_oid_str); - /* Now copy dbname. */ - strcpy(dbname, line + strlen(db_oid_str) + 1); + /* dbname is the rest of the line */ + dbname = line + strlen(db_oid_str) + 1; /* Remove \n from dbname. */ dbname[strlen(dbname) - 1] = '\0'; |