change surplus for() to while()
This commit is contained in:
parent
94605ebb2f
commit
22373a503a
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;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( /* void */ ; --n; dst++, src++) {
|
while (--n) {
|
||||||
*dst = *src;
|
*dst = *src;
|
||||||
|
|
||||||
if (*dst == '\0') {
|
if (*dst == '\0') {
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dst++;
|
||||||
|
src++;
|
||||||
}
|
}
|
||||||
|
|
||||||
*dst = '\0';
|
*dst = '\0';
|
||||||
|
|
Loading…
Reference in a new issue