Mercurial > hg > nginx
comparison src/core/ngx_string.c @ 3410:bfcc9be4f1c9
fix ngx_utf8_cpystrn(): it did not fully copy utf-8 string
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 11 Jan 2010 13:39:24 +0000 |
parents | b344b68da8c5 |
children | 5d28d30ba1b1 |
comparison
equal
deleted
inserted
replaced
3409:bb79608169eb | 3410:bfcc9be4f1c9 |
---|---|
1237 if (ngx_utf8_decode(&next, len) > 0x10ffff) { | 1237 if (ngx_utf8_decode(&next, len) > 0x10ffff) { |
1238 /* invalid UTF-8 */ | 1238 /* invalid UTF-8 */ |
1239 break; | 1239 break; |
1240 } | 1240 } |
1241 | 1241 |
1242 len--; | |
1243 | |
1244 while (src < next) { | 1242 while (src < next) { |
1245 *++dst = *++src; | 1243 *dst++ = *src++; |
1246 len--; | 1244 len--; |
1247 } | 1245 } |
1248 } | 1246 } |
1249 | 1247 |
1250 *dst = '\0'; | 1248 *dst = '\0'; |