From 16059d39a04f5307e9b4dade10e70e5a4939a6db Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 7 Feb 2007 00:52:35 +0000 Subject: Replace some strncpy() by strlcpy(). --- src/interfaces/ecpg/preproc/descriptor.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/interfaces/ecpg/preproc/descriptor.c') diff --git a/src/interfaces/ecpg/preproc/descriptor.c b/src/interfaces/ecpg/preproc/descriptor.c index f81d3c330c4..3da779a8b04 100644 --- a/src/interfaces/ecpg/preproc/descriptor.c +++ b/src/interfaces/ecpg/preproc/descriptor.c @@ -1,7 +1,7 @@ /* * functions needed for descriptor handling * - * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/descriptor.c,v 1.24 2006/03/11 04:38:40 momjian Exp $ + * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/descriptor.c,v 1.25 2007/02/07 00:52:35 petere Exp $ * * since descriptor might be either a string constant or a string var * we need to check for a constant if we expect a constant @@ -323,7 +323,6 @@ descriptor_variable(const char *name, int input) {descriptor_names[1], (struct ECPGtype *) & descriptor_type, 0, NULL} }; - strncpy(descriptor_names[input], name, MAX_DESCRIPTOR_NAMELEN); - descriptor_names[input][MAX_DESCRIPTOR_NAMELEN - 1] = 0; + strlcpy(descriptor_names[input], name, sizeof(descriptor_names[input])); return (struct variable *) & varspace[input]; } -- cgit v1.2.3