Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
if i=2,will cause undefined behavior,because array index out of bounds.
  • Loading branch information
Leviathan authored Oct 14, 2016
1 parent fe25a8e commit 6e851e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion example_copystack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int main()

stCoRoutine_t* co[2];
int routineid[2];
for (int i = 0; i < 3; i++)
for (int i = 0; i < 2; i++)
{
routineid[i] = i;
co_create(&co[i], &attr, RoutineFunc, routineid + i);
Expand Down

0 comments on commit 6e851e3

Please sign in to comment.