From 62cb600d7fa056e00d669583b17d0c25cb4c9df3 Mon Sep 17 00:00:00 2001 From: Enrico Fucile Date: Mon, 27 Oct 2014 14:28:47 +0000 Subject: [PATCH] fixed problem with pgps bufr test --- src/grib_accessor_class_bufr_data_array.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/grib_accessor_class_bufr_data_array.c b/src/grib_accessor_class_bufr_data_array.c index d0d2f7a82..8f356a364 100644 --- a/src/grib_accessor_class_bufr_data_array.c +++ b/src/grib_accessor_class_bufr_data_array.c @@ -339,9 +339,9 @@ static grib_sarray* decode_string_array(grib_context* c,unsigned char* data,long ret=grib_sarray_new(c,10,10); if (width) { grib_context_free(c,sval); - for (j=1;jnumberOfDataSubsets;j++) { - sval=(char*)grib_context_malloc_clear(c,width/8+1); - grib_decode_string(data,pos,width/8,sval); + for (j=0;jnumberOfDataSubsets;j++) { + sval=(char*)grib_context_malloc_clear(c,width+1); + grib_decode_string(data,pos,width,sval); grib_sarray_push(c,ret,sval); } } else { @@ -772,11 +772,8 @@ static int decode_elements(grib_accessor* a) { } else { if (ir>0) { n[ir-1]-=numberOfElementsToRepeat[ir]+2; - /* i=startRepetition[ir-1]; */ - i=startRepetition[ir]+numberOfElementsToRepeat[ir]; - } else { - i=startRepetition[ir]+numberOfElementsToRepeat[ir]; } + i=startRepetition[ir]+numberOfElementsToRepeat[ir]; numberOfNestedRepetitions--; } }