]> git.kaiwu.me - nginx.git/commitdiff
change surplus for() to while()
authorIgor Sysoev <igor@sysoev.ru>
Fri, 5 Jun 2009 12:33:49 +0000 (12:33 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Fri, 5 Jun 2009 12:33:49 +0000 (12:33 +0000)
src/core/ngx_string.c

index d73cb8699c530a3c1131603032c3f950bdbe7374..0e33e3804cade1ef43c57c23fd291e9cfe536be5 100644 (file)
@@ -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';