From 9ba14ac9db40ae7e3b0896ab64b3970fec2946ee Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Fri, 22 Dec 2006 20:30:26 +0000 Subject: [PATCH] fix for Linix/ppc64 or FreeBSD/amd64 in 32-bit mode, the same as in r934 --- src/core/ngx_cycle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c index 736600f0d..a3effb205 100644 --- a/src/core/ngx_cycle.c +++ b/src/core/ngx_cycle.c @@ -759,7 +759,7 @@ ngx_create_pidfile(ngx_str_t *name, ngx_log_t *log) size_t len; ngx_uint_t trunc; ngx_file_t file; - u_char pid[NGX_INT64_LEN]; + u_char pid[NGX_INT64_LEN + 2]; ngx_memzero(&file, sizeof(ngx_file_t)); @@ -778,7 +778,7 @@ ngx_create_pidfile(ngx_str_t *name, ngx_log_t *log) } if (!ngx_test_config) { - len = ngx_sprintf(pid, "%P%N", ngx_pid) - pid; + len = ngx_snprintf(pid, NGX_INT64_LEN + 2, "%P%N", ngx_pid) - pid; if (ngx_write_file(&file, pid, len, 0) == NGX_ERROR) { return NGX_ERROR;