Permalink
Browse files

bugfix: memset 0

  • Loading branch information...
1 parent 368b3b3 commit 07b67afcefdf95d26d6a0b9884eda7ef2adddd02 @cloudwu committed Jul 24, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 coroutine.c
View
2 coroutine.c
@@ -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;

0 comments on commit 07b67af

Please sign in to comment.