From 9cc197bb0c5083350f57e1e0a051f54de31e213b Mon Sep 17 00:00:00 2001 From: cmccarthy1 <38653604+cmccarthy1@users.noreply.github.com> Date: Mon, 15 Jun 2020 11:34:33 +0100 Subject: [PATCH] Issue with fixed length strings, raised in #25 (#26) * Building hdf5 from source * initial pass at new setup for hdf5 * addition of install.bat, test.q and restructure * update to directory structure * binary now hdf5 rather than libhdf5 * update to build location * dll in bin for hdf5 * use of path only * check for dll in Release, reintro of LD_LIBRARY_PATH * change to win build * change to travis_setup * revert * addition of include * Update hdf5.q * Update CMakeLists.txt * Rearranged paths * Update hdf5.q * Update hdf5.q * disable windows build * restart of testing windows * change to setup * reordering * change to build install dir * test * revert to initial travis_setup example * revert to allow linux tests to pass * revert to allow incorrect building and testing of windows * removal of 2nd mkdir cmake * revert to previous working version * removal of double mkdir * test * certificate check turned off * Change shared object to kdbhdf5 * Force windows to libkdbhdf5.dll so hdf5.q can find it on all OS * addition of slack test * addition of secure test * trigger secure build * removal of on pull request * kxsystems_travis * update to README and install script * change to indenting * fixed length string reads initialising at 1 rather than 0 * update to read for fixed length compound strings Co-authored-by: nmcdonnell-kx --- src/hdf5_read.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hdf5_read.c b/src/hdf5_read.c index 430eb18..5495d58 100644 --- a/src/hdf5_read.c +++ b/src/hdf5_read.c @@ -132,7 +132,7 @@ K readDataSimpleString(hid_t dset, hsize_t npoints, hid_t ntype, hid_t space, re H5Tset_size(stype, sz); fdata = (char *)calloc(npoints * sz, sizeof(char)); readfunc(dset, stype, H5S_ALL, H5S_ALL, H5P_DEFAULT, fdata); - for(i = 1; i < npoints; ++i) + for(i = 0; i < npoints; ++i) jk(&result, kp(fdata + i * sz)); free(fdata); } @@ -209,7 +209,7 @@ K readDataCompoundString(hid_t dset, char* mname, hsize_t npoints, hid_t mtype, H5Tinsert(memtype, mname, 0, stype); fdata = (char *)calloc(npoints * sz, sizeof(char)); readfunc(dset, memtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, fdata); - for(i = 1; i < npoints; ++i) + for(i = 0; i < npoints; ++i) jk(&result, kp(fdata + i * sz)); free(fdata); }