]> git.kaiwu.me - nginx.git/commitdiff
fix ngx_utf8_cpystrn(): it did not fully copy utf-8 string
authorIgor Sysoev <igor@sysoev.ru>
Mon, 11 Jan 2010 13:39:24 +0000 (13:39 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 11 Jan 2010 13:39:24 +0000 (13:39 +0000)
src/core/ngx_string.c

index 613ce93b8d8f63d102ce63ab771449929c02da90..8299134838c9f654c10c224a6315c0d9f9877955 100644 (file)
@@ -1239,10 +1239,8 @@ ngx_utf8_cpystrn(u_char *dst, u_char *src, size_t n, size_t len)
             break;
         }
 
-        len--;
-
         while (src < next) {
-            *++dst = *++src;
+            *dst++ = *src++;
             len--;
         }
     }