mirror of
https://github.com/nginx/nginx.git
synced 2026-06-26 20:01:45 +00:00
change surplus for() to while()
This commit is contained in:
parent
abf5d3fbe2
commit
8e5f0acbc2
1 changed files with 4 additions and 1 deletions
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue