From 9a7842d549ec8be3a97558f465cca6b954adce55 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 29 Jan 2024 12:30:49 +0000 Subject: [PATCH] Testing: GRIB bitmap as string --- src/grib_accessor_class_bitmap.cc | 5 +++-- tests/grib_bitmap.sh | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/grib_accessor_class_bitmap.cc b/src/grib_accessor_class_bitmap.cc index e5825a3c3..0bdc52d25 100644 --- a/src/grib_accessor_class_bitmap.cc +++ b/src/grib_accessor_class_bitmap.cc @@ -274,7 +274,7 @@ static void update_size(grib_accessor* a, size_t s) static int unpack_string(grib_accessor* a, char* val, size_t* len) { - int i = 0; + long i = 0; grib_handle* hand = grib_handle_of_accessor(a); if (len[0] < (a->length)) { @@ -284,8 +284,9 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) return GRIB_ARRAY_TOO_SMALL; } - for (i = 0; i < a->length; i++) + for (i = 0; i < a->length; i++) { val[i] = hand->buffer->data[a->offset + i]; + } len[0] = a->length; diff --git a/tests/grib_bitmap.sh b/tests/grib_bitmap.sh index 46d213a0d..75da0d70a 100755 --- a/tests/grib_bitmap.sh +++ b/tests/grib_bitmap.sh @@ -156,5 +156,13 @@ set -e grep -q "missing bitmap" $tempOut +# bitmap as string +cat > $tempRules<