Fix incorrect snprintf() limit.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 23 May 2015 20:05:52 +0000 (16:05 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 23 May 2015 20:05:52 +0000 (16:05 -0400)
Typo in commit 7cbee7c0a.  No practical effect since the buffer should
never actually be overrun, but various compilers and static analyzers will
whine about it.

Petr Jelinek

src/backend/access/transam/xlog.c

index 87a3b489142bc585c2f7198604835f8e661d9a98..b913bf3ebcbbd0da80fd539aaf788140cf0f9ab8 100644 (file)
@@ -7279,7 +7279,7 @@ StartupXLOG(void)
                                char            partialpath[MAXPGPATH];
 
                                XLogFilePath(origpath, EndOfLogTLI, endLogSegNo);
-                               snprintf(partialfname, MAXPGPATH, "%s.partial", origfname);
+                               snprintf(partialfname, MAXFNAMELEN, "%s.partial", origfname);
                                snprintf(partialpath, MAXPGPATH, "%s.partial", origpath);
 
                                /*