Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a6017cf

Browse files
committed
Use sizeof() for snprintf() buffer length.
1 parent 5b4fa95 commit a6017cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/port/exec.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/port/exec.c,v 1.54 2007/01/29 20:17:40 momjian Exp $
12+
* $PostgreSQL: pgsql/src/port/exec.c,v 1.55 2007/01/29 20:22:35 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -590,7 +590,7 @@ pclose_check(FILE *stream)
590590
{
591591
char str[256];
592592

593-
snprintf(str, 256, "%d: %s", WTERMSIG(exitstatus),
593+
snprintf(str, sizeof(str), "%d: %s", WTERMSIG(exitstatus),
594594
WTERMSIG(exitstatus) < NSIG ?
595595
sys_siglist[WTERMSIG(exitstatus)] : "(unknown)");
596596
log_error(_("child process was terminated by signal %s"), str);

0 commit comments

Comments
 (0)