summaryrefslogtreecommitdiff
path: root/src/core/ngx_string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ngx_string.c')
-rw-r--r--src/core/ngx_string.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c
index 7a73ef527..568907209 100644
--- a/src/core/ngx_string.c
+++ b/src/core/ngx_string.c
@@ -29,6 +29,22 @@ ngx_strlow(u_char *dst, u_char *src, size_t n)
}
+size_t
+ngx_strnlen(u_char *p, size_t n)
+{
+ size_t i;
+
+ for (i = 0; i < n; i++) {
+
+ if (p[i] == '\0') {
+ return i;
+ }
+ }
+
+ return n;
+}
+
+
u_char *
ngx_cpystrn(u_char *dst, u_char *src, size_t n)
{