diff options
author | Igor Sysoev <igor@sysoev.ru> | 2008-11-25 14:26:32 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2008-11-25 14:26:32 +0300 |
commit | 33930d82ce80dd4cd2c20e732940d4c88e411a98 (patch) | |
tree | 05b195228ac711771ccb13809683d1929e805b03 /src/os/unix/ngx_errno.c | |
parent | de2f8c4ca54eb5f156f21b993537d7316469bb0f (diff) |
ngx_strerror_r() style and size == 0 bug fix
Diffstat (limited to 'src/os/unix/ngx_errno.c')
-rw-r--r-- | src/os/unix/ngx_errno.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/os/unix/ngx_errno.c b/src/os/unix/ngx_errno.c index a3addf00c..a250f496d 100644 --- a/src/os/unix/ngx_errno.c +++ b/src/os/unix/ngx_errno.c @@ -10,10 +10,11 @@ #if (NGX_HAVE_STRERROR_R) -u_char *ngx_strerror_r(int err, u_char *errstr, size_t size) +u_char * +ngx_strerror_r(int err, u_char *errstr, size_t size) { if (size == 0) { - return 0; + return errstr; } errstr[0] = '\0'; @@ -32,12 +33,13 @@ u_char *ngx_strerror_r(int err, u_char *errstr, size_t size) /* Linux strerror_r() */ -u_char *ngx_strerror_r(int err, u_char *errstr, size_t size) +u_char * +ngx_strerror_r(int err, u_char *errstr, size_t size) { char *str; if (size == 0) { - return 0; + return errstr; } errstr[0] = '\0'; |