From 2b93b2c57f8fea99ed9a5de520b274696e058faf Mon Sep 17 00:00:00 2001 From: cnlohr Date: Wed, 15 Mar 2017 21:32:09 -0400 Subject: fix puff for headset. --- src/survive.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/survive.c') diff --git a/src/survive.c b/src/survive.c index 1b5bed1..3c16353 100755 --- a/src/survive.c +++ b/src/survive.c @@ -253,8 +253,8 @@ struct SurviveObject * survive_get_so_by_name( struct SurviveContext * ctx, cons int survive_simple_inflate( struct SurviveContext * ctx, const char * input, int inlen, char * output, int outlen ) { unsigned long ol = outlen; - unsigned long il = inlen; - int ret = puff( output, &ol, input, &il ); + unsigned long il = inlen-2; + int ret = puff( output, &ol, input+2, &il ); if( ret == 0 ) return ol; else -- cgit v1.2.3 From a15a75ea846f434691fc30f0db79e5fa844c065c Mon Sep 17 00:00:00 2001 From: cnlohr Date: Wed, 15 Mar 2017 21:34:33 -0400 Subject: add note about extra 2 bytes. --- src/survive.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/survive.c') diff --git a/src/survive.c b/src/survive.c index 3c16353..a756f3e 100755 --- a/src/survive.c +++ b/src/survive.c @@ -252,6 +252,7 @@ struct SurviveObject * survive_get_so_by_name( struct SurviveContext * ctx, cons int survive_simple_inflate( struct SurviveContext * ctx, const char * input, int inlen, char * output, int outlen ) { + //Tricky: we actually get 2 bytes of data on the front. I don't know what it's for. 0x78 0x9c - puff doesn't deal with it well. unsigned long ol = outlen; unsigned long il = inlen-2; int ret = puff( output, &ol, input+2, &il ); -- cgit v1.2.3 From 9378bfbd11e0e476a8e0477a74ac918b931a690f Mon Sep 17 00:00:00 2001 From: CNLohr Date: Thu, 16 Mar 2017 04:14:26 -0400 Subject: Fix: Initialize both lighthouse configs. --- src/survive.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/survive.c') diff --git a/src/survive.c b/src/survive.c index a756f3e..b2e4ae3 100755 --- a/src/survive.c +++ b/src/survive.c @@ -55,7 +55,8 @@ SurviveContext * survive_init( int headless ) ctx->lh_config = malloc( sizeof(config_group) * NUM_LIGHTHOUSES); init_config_group(ctx->global_config_values,10); - init_config_group(ctx->lh_config,10); + init_config_group(&ctx->lh_config[0],10); + init_config_group(&ctx->lh_config[1],10); config_read(ctx, "config.json"); -- cgit v1.2.3