Klaus Demo nginx / 33930d8
ngx_strerror_r() style and size == 0 bug fix Igor Sysoev 13 years ago
2 changed file(s) with 8 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
99
1010 #if (NGX_HAVE_STRERROR_R)
1111
12 u_char *ngx_strerror_r(int err, u_char *errstr, size_t size)
12 u_char *
13 ngx_strerror_r(int err, u_char *errstr, size_t size)
1314 {
1415 if (size == 0) {
15 return 0;
16 return errstr;
1617 }
1718
1819 errstr[0] = '\0';
3132
3233 /* Linux strerror_r() */
3334
34 u_char *ngx_strerror_r(int err, u_char *errstr, size_t size)
35 u_char *
36 ngx_strerror_r(int err, u_char *errstr, size_t size)
3537 {
3638 char *str;
3739
3840 if (size == 0) {
39 return 0;
41 return errstr;
4042 }
4143
4244 errstr[0] = '\0';
9090 };
9191
9292
93 u_char *ngx_strerror_r(ngx_err_t err, u_char *errstr, size_t size)
93 u_char *
94 ngx_strerror_r(ngx_err_t err, u_char *errstr, size_t size)
9495 {
9596 int n;
9697 u_int len;