Skip to content

Commit

Permalink
change surplus for() to while()
Browse files Browse the repository at this point in the history
  • Loading branch information
is committed Jun 5, 2009
1 parent 31447c5 commit 81c863c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/ngx_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 81c863c

Please sign in to comment.