[H5r-commits] r91 - src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 27 19:46:20 CET 2013


Author: extemporaneousb
Date: 2013-02-27 19:46:20 +0100 (Wed, 27 Feb 2013)
New Revision: 91

Modified:
   src/h5_wrap.c
Log:
Fixed bug in 0-length slab.



Modified: src/h5_wrap.c
===================================================================
--- src/h5_wrap.c	2013-01-11 17:58:36 UTC (rev 90)
+++ src/h5_wrap.c	2013-02-27 18:46:20 UTC (rev 91)
@@ -549,8 +549,12 @@
     
   for (i = 0; i < rlen; i++) {
     INTEGER(_SEXP_offsets)[0] = offsets[i];
-    INTEGER(_SEXP_counts)[0] = counts[i];
-    SET_VECTOR_ELT(r_lst, i, h5R_read_dataset(h5_dataset, _SEXP_offsets, _SEXP_counts));
+    INTEGER(_SEXP_counts)[0]  = counts[i];
+    if (counts[i] <= 0) {
+	SET_VECTOR_ELT(r_lst, i, R_NilValue);
+    } else {
+	SET_VECTOR_ELT(r_lst, i, h5R_read_dataset(h5_dataset, _SEXP_offsets, _SEXP_counts));
+    }
   }
   UNPROTECT(3);
   return(r_lst);



More information about the H5r-commits mailing list