diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2019-12-04 19:36:06 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2019-12-04 19:36:06 -0300 |
commit | 0b9466fce2cf4f8c32b3a9170ca272829aa11e66 (patch) | |
tree | 386bbebd3e2de5a4b4443f6fdfc5c130c30f3b1b /src/bin/scripts/common.c | |
parent | b1abfec825472434ea445b9700eaa80cde9da86a (diff) | |
download | postgresql-0b9466fce2cf4f8c32b3a9170ca272829aa11e66.tar.gz postgresql-0b9466fce2cf4f8c32b3a9170ca272829aa11e66.zip |
Offer pnstrdup to frontend code
We already had it on the backend. Frontend can also use it now.
Discussion: https://postgr.es/m/20191204144021.GA17976@alvherre.pgsql
Diffstat (limited to 'src/bin/scripts/common.c')
-rw-r--r-- | src/bin/scripts/common.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/bin/scripts/common.c b/src/bin/scripts/common.c index 680bbb133a3..965572897f9 100644 --- a/src/bin/scripts/common.c +++ b/src/bin/scripts/common.c @@ -353,8 +353,7 @@ splitTableColumnsSpec(const char *spec, int encoding, else cp += PQmblen(cp, encoding); } - *table = pg_strdup(spec); - (*table)[cp - spec] = '\0'; /* no strndup */ + *table = pnstrdup(spec, cp - spec); *columns = cp; } |