From ba876c150a83b227bb5a6e78e295e45077ed02cf Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 28 Nov 1996 05:46:08 +0000 Subject: [PATCH] Changed saved_relname size to save memory. --- src/backend/parser/gram.y | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index df5305d0d0..da8f5244d1 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -1,6 +1,6 @@ %{ /* -*-text-*- */ -#define YYDEBUG 1 +/*#define YYDEBUG 1*/ /*------------------------------------------------------------------------- * * gram.y-- @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.17 1996/11/20 22:58:22 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.18 1996/11/28 05:46:08 momjian Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -44,7 +44,7 @@ #include "utils/elog.h" #include "access/xact.h" -static char saved_relname[BUFSIZ]; /* need this for complex attributes */ +static char saved_relname[NAMEDATALEN]; /* need this for complex attributes */ static bool QueryIsRule = FALSE; extern List *parsetree; @@ -1986,7 +1986,8 @@ opt_id: Id { $$ = $1; } relation_name: SpecialRuleRelation { $$ = $1; - strcpy(saved_relname, $1); + strncpy(saved_relname, $1, NAMEDATALEN); + saved_relname[NAMEDATALEN-1] = '\0'; } | Id { @@ -1999,7 +2000,8 @@ relation_name: SpecialRuleRelation } else { $$ = $1; } - strcpy(saved_relname, $1); + strncpy(saved_relname, $1, NAMEDATALEN); + saved_relname[NAMEDATALEN-1] = '\0'; } ; -- 2.40.0