aboutsummaryrefslogtreecommitdiff
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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c
index d73cb8699..0e33e3804 100644
--- a/src/core/ngx_string.c
+++ b/src/core/ngx_string.c
@@ -30,12 +30,15 @@ ngx_cpystrn(u_char *dst, u_char *src, size_t n)
return dst;
}
- for ( /* void */ ; --n; dst++, src++) {
+ while (--n) {
*dst = *src;
if (*dst == '\0') {
return dst;
}
+
+ dst++;
+ src++;
}
*dst = '\0';