Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera2019-12-04 22:36:06 +0000
committerAlvaro Herrera2019-12-04 22:36:06 +0000
commit0b9466fce2cf4f8c32b3a9170ca272829aa11e66 (patch)
tree386bbebd3e2de5a4b4443f6fdfc5c130c30f3b1b /src/bin/scripts/common.c
parentb1abfec825472434ea445b9700eaa80cde9da86a (diff)
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.c3
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;
}