Skip to content

Commit

Permalink
bugfix: memset 0
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwu committed Jul 24, 2012
1 parent 368b3b3 commit 07b67af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion coroutine.c
Expand Up @@ -82,7 +82,7 @@ coroutine_new(struct schedule *S, coroutine_func func, void *ud) {
int id = S->cap;
S->cap *= 2;
S->co = realloc(S->co, S->cap * 2 * sizeof(struct coroutine *));
memset(S->co + S->cap , 0 , sizeof(struct coroutine *) * 2);
memset(S->co + S->cap , 0 , sizeof(struct coroutine *) * S->cap);
S->co[S->cap] = co;
S->cap *= 2;
++S->nco;
Expand Down

0 comments on commit 07b67af

Please sign in to comment.