Mercurial > MadButterfly
comparison src/redraw_man.c @ 523:c3fe9e4bdec1 Android_Skia
Fix a bug of a non-initialized variable.
pos_cnt is not initialized before used. It causes
- tank shows nothing at begining.
- dynamic being segmentation fault for any X event at first few seconds.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Tue, 22 Dec 2009 11:04:52 +0800 |
parents | fa2ccf39ba53 |
children | dcf4673896f4 |
comparison
equal
deleted
inserted
replaced
522:abaf96c8d7ef | 523:c3fe9e4bdec1 |
---|---|
1347 poses = (co_aix (*)[2])malloc(sizeof(co_aix [2]) * max_poses); | 1347 poses = (co_aix (*)[2])malloc(sizeof(co_aix [2]) * max_poses); |
1348 if(poses == NULL) | 1348 if(poses == NULL) |
1349 return ERR; | 1349 return ERR; |
1350 } | 1350 } |
1351 | 1351 |
1352 pos_cnt = 0; | |
1352 FORCHILDREN(coord, child) { | 1353 FORCHILDREN(coord, child) { |
1353 if(child->flags & COF_OWN_CANVAS) { | 1354 if(child->flags & COF_OWN_CANVAS) { |
1354 area_to_positions(coord_get_area(child), poses + pos_cnt); | 1355 area_to_positions(coord_get_area(child), poses + pos_cnt); |
1355 pos_cnt += 2; | 1356 pos_cnt += 2; |
1356 } | 1357 } |