Skip to content

Commit db84f39

Browse files
committed
Tentative, robust fix for #221 that does not immediately introduce other issues into ncdump. Broader validation pending.
1 parent bb7b0d3 commit db84f39

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

gdb.txt

+25-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,37 @@
1+
set breakpoint pending on
12

3+
break nc4hdf.c:872
4+
command
5+
watch provide_fill
6+
c
7+
end
8+
9+
break vardata.c:473
10+
command
11+
watch vals
12+
end
13+
14+
15+
break dumplib.c:1063
16+
command
17+
print len
18+
end
19+
20+
break ncdump.c:1687
21+
22+
break nc4hdf.c:1126
23+
24+
run tst_empty_vlen_unlim.nc
225

326
#----------
427
# Solved first set of problems. On to second, in print_any_val.
528
#---------
6-
#set breakpoint pending on
29+
#
30+
731

8-
#break nc4hdf.c:872
9-
#command
10-
#watch provide_fill
11-
#c
12-
#end
1332

1433

1534
#break nc4hdf.c:974
1635
#command
1736
#print fill_value_size
1837
#end
19-
20-
#break nc4hdf.c:1126

libsrc4/nc4hdf.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,11 @@ nc4_get_vara(NC *nc, int ncid, int varid, const size_t *startp,
11591159
*(char **)filldata = NULL;
11601160
}
11611161
else if(var->type_info->nc_type_class == NC_VLEN) {
1162-
continue;
1162+
if(fillvalue) {
1163+
memcpy(filldata,fillvalue,file_type_size);
1164+
} else {
1165+
*(char **)filldata = NULL;
1166+
}
11631167
} else
11641168
memcpy(filldata, fillvalue, file_type_size);
11651169
filldata = (char *)filldata + file_type_size;

0 commit comments

Comments
 (0)