diff --git a/src/grib_dumper_class_bufr_encode_C.c b/src/grib_dumper_class_bufr_encode_C.c index 5f1f4fa96..ec8c5c935 100644 --- a/src/grib_dumper_class_bufr_encode_C.c +++ b/src/grib_dumper_class_bufr_encode_C.c @@ -386,9 +386,9 @@ static void dump_long(grib_dumper* d,grib_accessor* a, const char* comment) fprintf(self->dumper.out," CODES_CHECK(codes_set_long_array(h, \"%s\", ivalues, size), 0);\n",a->name); } else { + int doing_unexpandedDescriptors=0; r=compute_bufr_key_rank(h,self->keys,a->name); sval=lval_to_string(c,value); - int doing_unexpandedDescriptors=0; if (r!=0) { fprintf(self->dumper.out," CODES_CHECK(codes_set_long(h, \"#%d#%s\", ", r,a->name); } else { diff --git a/src/grib_dumper_class_bufr_encode_fortran.c b/src/grib_dumper_class_bufr_encode_fortran.c index 625a310bf..73364d8f8 100644 --- a/src/grib_dumper_class_bufr_encode_fortran.c +++ b/src/grib_dumper_class_bufr_encode_fortran.c @@ -395,9 +395,9 @@ static void dump_long(grib_dumper* d,grib_accessor* a, const char* comment) fprintf(self->dumper.out," call codes_set(ibufr,'%s',ivalues)\n",a->name); } else { + int doing_unexpandedDescriptors=0; r=compute_bufr_key_rank(h,self->keys,a->name); sval=lval_to_string(c,value); - int doing_unexpandedDescriptors=0; if (r!=0) { fprintf(self->dumper.out," call codes_set(ibufr,'#%d#%s',",r,a->name); } else { diff --git a/src/grib_dumper_class_bufr_encode_python.c b/src/grib_dumper_class_bufr_encode_python.c index a4d44ff36..d2d4e5417 100644 --- a/src/grib_dumper_class_bufr_encode_python.c +++ b/src/grib_dumper_class_bufr_encode_python.c @@ -379,9 +379,9 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) fprintf(self->dumper.out," codes_set_array(ibufr, '%s', ivalues)\n",a->name); } else { + int doing_unexpandedDescriptors=0; r=compute_bufr_key_rank(h,self->keys,a->name); sval=lval_to_string(c,value); - int doing_unexpandedDescriptors=0; if (r!=0) { fprintf(self->dumper.out," codes_set(ibufr, '#%d#%s', ",r,a->name); } else {