diff options
author | cnlohr <lohr85@gmail.com> | 2017-03-18 13:15:22 -0400 |
---|---|---|
committer | cnlohr <lohr85@gmail.com> | 2017-03-18 13:15:22 -0400 |
commit | af81a4dbe0e58e94b61b11c14b21a2decc15d823 (patch) | |
tree | fd4306a49ff5a2a47102e22fc0eb5b072eb1a892 /src/survive_vive.c | |
parent | 0b88a13fb38e41dc45af76137c5fbd287120b9d2 (diff) | |
download | libsurvive-af81a4dbe0e58e94b61b11c14b21a2decc15d823.tar.gz libsurvive-af81a4dbe0e58e94b61b11c14b21a2decc15d823.tar.bz2 |
Fix unititialized array.
Diffstat (limited to 'src/survive_vive.c')
-rwxr-xr-x | src/survive_vive.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/survive_vive.c b/src/survive_vive.c index 91efc2c..c8e2b55 100755 --- a/src/survive_vive.c +++ b/src/survive_vive.c @@ -920,7 +920,7 @@ static void handle_watchman( SurviveObject * w, uint8_t * readdata ) { uint8_t *marked; marked = alloca(nrtime); - memset( marked, 0, sizeof( marked ) ); + memset( marked, 0, sizeof( nrtime ) ); int i, parpl = 0; timecount--; int timepl = 0; @@ -935,6 +935,7 @@ static void handle_watchman( SurviveObject * w, uint8_t * readdata ) while( marked[timepl] ) timepl++; if( timepl > timecount ) { fault = 3; goto end; } //Ran off max of list. uint32_t endtime = times[timepl++]; + int end = timepl + adv; if( end > timecount ) { fault = 4; goto end; } //end referencing off list if( marked[end] > 0 ) { fault = 5; goto end; } //Already marked trying to be used. @@ -978,7 +979,7 @@ static void handle_watchman( SurviveObject * w, uint8_t * readdata ) end: { SurviveContext * ctx = w->ctx; - SV_INFO( "Light decoding fault: %d\n", fault ); + SV_INFO( "Light decoding fault: %d", fault ); } } } |