Skip to content

Commit 46f4ed4

Browse files
committed
Allocate proper length for sprintf string, from Tatsuo.
1 parent ea0b5c8 commit 46f4ed4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

contrib/dbmirror/pending.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************
22
* pending.c
3-
* $Id: pending.c,v 1.9 2002/11/22 16:25:29 tgl Exp $
3+
* $Id: pending.c,v 1.10 2002/11/26 03:08:00 momjian Exp $
44
*
55
* This file contains a trigger for Postgresql-7.x to record changes to tables
66
* to a pending table for mirroring.
@@ -95,11 +95,11 @@ recordchange(PG_FUNCTION_ARGS)
9595
#ifndef NOSCHEMAS
9696
schemaname = get_namespace_name(RelationGetNamespace(trigdata->tg_relation));
9797
fullyqualtblname = SPI_palloc(strlen(tblname) +
98-
strlen(schemaname) + 4);
98+
strlen(schemaname) + 6);
9999
sprintf(fullyqualtblname,"\"%s\".\"%s\"",
100100
schemaname,tblname);
101101
#else
102-
fullyqualtblname = SPI_palloc(strlen(tblname+3));
102+
fullyqualtblname = SPI_palloc(strlen(tblname + 3));
103103
sprintf(fullyqualtblname,"\"%s\"",tblname);
104104
#endif
105105
tupdesc = trigdata->tg_relation->rd_att;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy