Mercurial > hg > nginx
comparison src/core/ngx_string.c @ 2919:41e7d9153967
change surplus for() to while()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 05 Jun 2009 12:33:49 +0000 |
parents | 819bea4e964e |
children | 52e984126b2c |
comparison
equal
deleted
inserted
replaced
2918:0070504324d8 | 2919:41e7d9153967 |
---|---|
28 { | 28 { |
29 if (n == 0) { | 29 if (n == 0) { |
30 return dst; | 30 return dst; |
31 } | 31 } |
32 | 32 |
33 for ( /* void */ ; --n; dst++, src++) { | 33 while (--n) { |
34 *dst = *src; | 34 *dst = *src; |
35 | 35 |
36 if (*dst == '\0') { | 36 if (*dst == '\0') { |
37 return dst; | 37 return dst; |
38 } | 38 } |
39 | |
40 dst++; | |
41 src++; | |
39 } | 42 } |
40 | 43 |
41 *dst = '\0'; | 44 *dst = '\0'; |
42 | 45 |
43 return dst; | 46 return dst; |