diff options
Diffstat (limited to 'src/bin/scripts/common.c')
-rw-r--r-- | src/bin/scripts/common.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bin/scripts/common.c b/src/bin/scripts/common.c index afa62e4da73..d446d7af9fa 100644 --- a/src/bin/scripts/common.c +++ b/src/bin/scripts/common.c @@ -25,6 +25,8 @@ #define ERRCODE_UNDEFINED_TABLE "42P01" +#define PQmblenBounded(s, e) strnlen(s, PQmblen(s, e)) + /* * Provide strictly harmonized handling of --help and --version * options. @@ -368,7 +370,7 @@ splitTableColumnsSpec(const char *spec, int encoding, cp++; } else - cp += PQmblen(cp, encoding); + cp += PQmblenBounded(cp, encoding); } *table = pnstrdup(spec, cp - spec); *columns = cp; |