Mercurial > hg > nginx
diff src/core/ngx_string.c @ 290:87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 16 Mar 2004 07:10:12 +0000 |
parents | c0552e5ab567 |
children | 0376cffa29e6 |
line wrap: on
line diff
--- a/src/core/ngx_string.c +++ b/src/core/ngx_string.c @@ -3,7 +3,7 @@ #include <ngx_core.h> -char *ngx_cpystrn(char *dst, char *src, size_t n) +u_char *ngx_cpystrn(u_char *dst, u_char *src, size_t n) { if (n == 0) { return dst; @@ -23,7 +23,7 @@ char *ngx_cpystrn(char *dst, char *src, } -int ngx_rstrncmp(char *s1, char *s2, size_t n) +ngx_int_t ngx_rstrncmp(u_char *s1, u_char *s2, size_t n) { if (n == 0) { return 0; @@ -33,7 +33,7 @@ int ngx_rstrncmp(char *s1, char *s2, siz for ( ;; ) { if (s1[n] != s2[n]) { - return (u_char) s1[n] - (u_char) s2[n]; + return s1[n] - s2[n]; } if (n == 0) { @@ -45,9 +45,9 @@ int ngx_rstrncmp(char *s1, char *s2, siz } -int ngx_atoi(char *line, size_t n) +ngx_int_t ngx_atoi(u_char *line, size_t n) { - int value; + ngx_int_t value; if (n == 0) { return NGX_ERROR; @@ -69,10 +69,10 @@ int ngx_atoi(char *line, size_t n) } -void ngx_md5_text(char *text, u_char *md5) +void ngx_md5_text(u_char *text, u_char *md5) { - int i; - static char hex[] = "0123456789abcdef"; + int i; + static u_char hex[] = "0123456789abcdef"; for (i = 0; i < 16; i++) { *text++ = hex[md5[i] >> 4];