diff src/core/ngx_cycle.c @ 270:6eb1e38f0f1f NGINX_0_5_5

nginx 0.5.5 *) Change: the -v switch does not show compiler information any more. *) Feature: the -V switch. *) Feature: the "worker_rlimit_core" directive supports size in K, M, and G. *) Bugfix: the nginx.pm module now could be installed by an unprivileged user. *) Bugfix: a segmentation fault might occur if the $r->request_body or $r->request_body_file methods were used. *) Bugfix: the ppc platform specific bugs.
author Igor Sysoev <http://sysoev.ru>
date Sun, 24 Dec 2006 00:00:00 +0300
parents 6ae1357b7b7c
children 29a6403156b0
line wrap: on
line diff
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -759,7 +759,7 @@ ngx_create_pidfile(ngx_str_t *name, ngx_
     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_
     }
 
     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;