mirror of
https://github.com/postgres/postgres.git
synced 2026-04-22 14:47:29 -04:00
Allocate proper length for sprintf string, from Tatsuo.
This commit is contained in:
parent
d59f12daee
commit
805acc16b8
1 changed files with 3 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/****************************************************************************
|
||||
* pending.c
|
||||
* $Id: pending.c,v 1.6.2.3 2002/11/22 16:25:52 tgl Exp $
|
||||
* $Id: pending.c,v 1.6.2.4 2002/11/26 03:08:23 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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue