From: Bruce Momjian Date: Tue, 26 Nov 2002 03:08:00 +0000 (+0000) Subject: Allocate proper length for sprintf string, from Tatsuo. X-Git-Tag: REL7_4_BETA1~1481 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46f4ed492191f71f8fade41879bd6d594e8a8717;p=postgresql Allocate proper length for sprintf string, from Tatsuo. --- diff --git a/contrib/dbmirror/pending.c b/contrib/dbmirror/pending.c index 79d875456d..85a8385d3d 100644 --- a/contrib/dbmirror/pending.c +++ b/contrib/dbmirror/pending.c @@ -1,6 +1,6 @@ /**************************************************************************** * pending.c - * $Id: pending.c,v 1.9 2002/11/22 16:25:29 tgl Exp $ + * $Id: pending.c,v 1.10 2002/11/26 03:08:00 momjian Exp $ * * This file contains a trigger for Postgresql-7.x to record changes to tables * to a pending table for mirroring. @@ -95,11 +95,11 @@ recordchange(PG_FUNCTION_ARGS) #ifndef NOSCHEMAS schemaname = get_namespace_name(RelationGetNamespace(trigdata->tg_relation)); fullyqualtblname = SPI_palloc(strlen(tblname) + - strlen(schemaname) + 4); + strlen(schemaname) + 6); sprintf(fullyqualtblname,"\"%s\".\"%s\"", schemaname,tblname); #else - fullyqualtblname = SPI_palloc(strlen(tblname+3)); + fullyqualtblname = SPI_palloc(strlen(tblname + 3)); sprintf(fullyqualtblname,"\"%s\"",tblname); #endif tupdesc = trigdata->tg_relation->rd_att;