summaryrefslogtreecommitdiffstats
path: root/java/src/jni/h5util.c
diff options
context:
space:
mode:
authorJordan Henderson <jhenderson@hdfgroup.org>2019-02-12 17:41:55 (GMT)
committerJordan Henderson <jhenderson@hdfgroup.org>2019-02-12 17:56:42 (GMT)
commit3acd486b83f319579b1c6884c90289b0eb1d44a6 (patch)
treef4b0093c1915d2fbd704ea1948b80ba089ab82f5 /java/src/jni/h5util.c
parent8f42566f7ac087504c115c7d98b79c56604c2ebe (diff)
downloadhdf5-3acd486b83f319579b1c6884c90289b0eb1d44a6.zip
hdf5-3acd486b83f319579b1c6884c90289b0eb1d44a6.tar.gz
hdf5-3acd486b83f319579b1c6884c90289b0eb1d44a6.tar.bz2
Fixes for JNI updates
Diffstat (limited to 'java/src/jni/h5util.c')
-rw-r--r--java/src/jni/h5util.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c
index 4208ce1..fce969e 100644
--- a/java/src/jni/h5util.c
+++ b/java/src/jni/h5util.c
@@ -232,7 +232,7 @@ h5str_convert
HDmemcpy(cptr, &tmp_double, sizeof(double));
break;
}
-#if H5_SIZEOF_LONG_DOUBLE != 0
+#if H5_SIZEOF_LONG_DOUBLE != 0 && H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE
case sizeof(long double):
{
long double tmp_ldouble = 0.0;
@@ -259,6 +259,8 @@ h5str_convert
if (len > 0) {
HDstrncpy(cptr, this_str, typeSize);
+ cptr[typeSize - 1] = '\0';
+
retVal = typeSize;
}
else {
@@ -329,6 +331,7 @@ h5str_convert
break;
}
+#if H5_SIZEOF_LONG != H5_SIZEOF_INT
case sizeof(long):
{
unsigned long tmp_ulong = 0;
@@ -345,7 +348,7 @@ h5str_convert
break;
}
-
+#endif
#if H5_SIZEOF_LONG_LONG != H5_SIZEOF_LONG
case sizeof(long long):
{
@@ -444,14 +447,14 @@ h5str_convert
value = &tmp_ushort;
break;
}
-
+#if H5_SIZEOF_LONG != H5_SIZEOF_INT
case sizeof(long):
{
unsigned long tmp_ulong = 0;
value = &tmp_ulong;
break;
}
-
+#endif
#if H5_SIZEOF_LONG_LONG != H5_SIZEOF_LONG
case sizeof(long long):
{
@@ -694,7 +697,7 @@ h5str_sprintf
break;
}
-#if H5_SIZEOF_LONG_DOUBLE != 0
+#if H5_SIZEOF_LONG_DOUBLE != 0 && H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE
case sizeof(long double):
{
long double tmp_ldouble = 0.0;
@@ -750,6 +753,7 @@ h5str_sprintf
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
HDstrncpy(this_str, tmp_str, typeSize);
+ this_str[typeSize] = '\0';
}
}
@@ -844,7 +848,7 @@ h5str_sprintf
break;
}
-
+#if H5_SIZEOF_LONG != H5_SIZEOF_INT
case sizeof(long):
{
unsigned long tmp_ulong = 0;
@@ -871,7 +875,7 @@ h5str_sprintf
break;
}
-
+#endif
#if H5_SIZEOF_LONG_LONG != H5_SIZEOF_LONG
case sizeof(long long):
{