Commit a6017cff authored by Bruce Momjian's avatar Bruce Momjian

Use sizeof() for snprintf() buffer length.

parent 5b4fa959
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/port/exec.c,v 1.54 2007/01/29 20:17:40 momjian Exp $ * $PostgreSQL: pgsql/src/port/exec.c,v 1.55 2007/01/29 20:22:35 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -590,7 +590,7 @@ pclose_check(FILE *stream) ...@@ -590,7 +590,7 @@ pclose_check(FILE *stream)
{ {
char str[256]; char str[256];
snprintf(str, 256, "%d: %s", WTERMSIG(exitstatus), snprintf(str, sizeof(str), "%d: %s", WTERMSIG(exitstatus),
WTERMSIG(exitstatus) < NSIG ? WTERMSIG(exitstatus) < NSIG ?
sys_siglist[WTERMSIG(exitstatus)] : "(unknown)"); sys_siglist[WTERMSIG(exitstatus)] : "(unknown)");
log_error(_("child process was terminated by signal %s"), str); log_error(_("child process was terminated by signal %s"), str);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment