Mercurial > hg > nginx
comparison src/core/ngx_string.c @ 1029:ce08bc4cb97b
ngx_strn2cmp() > ngx_memn2cmp()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 12 Jan 2007 21:58:02 +0000 |
parents | eeadc558e86d |
children | db7c468c447d |
comparison
equal
deleted
inserted
replaced
1028:af57bfd77b7f | 1029:ce08bc4cb97b |
---|---|
485 } | 485 } |
486 } | 486 } |
487 | 487 |
488 | 488 |
489 ngx_int_t | 489 ngx_int_t |
490 ngx_strn2cmp(u_char *s1, u_char *s2, size_t n1, size_t n2) | 490 ngx_memn2cmp(u_char *s1, u_char *s2, size_t n1, size_t n2) |
491 { | 491 { |
492 size_t n; | 492 size_t n; |
493 ngx_int_t m, z; | 493 ngx_int_t m, z; |
494 | 494 |
495 if (n1 <= n2) { | 495 if (n1 <= n2) { |
499 } else { | 499 } else { |
500 n = n2; | 500 n = n2; |
501 z = 1; | 501 z = 1; |
502 } | 502 } |
503 | 503 |
504 m = ngx_strncmp(s1, s2, n); | 504 m = ngx_memcmp(s1, s2, n); |
505 | 505 |
506 if (m || n1 == n2) { | 506 if (m || n1 == n2) { |
507 return m; | 507 return m; |
508 } | 508 } |
509 | 509 |