Updates to tools warning PR from code review.

This commit is contained in:
Dana Robinson 2020-04-26 02:54:29 -07:00
parent a8676d74d9
commit de3bfa697a
2 changed files with 8 additions and 12 deletions

View File

@ -152,7 +152,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
* HDfree(array);
*/
#define H5TEST_ALLOCATE_2D_ARRAY(ARR, TYPE, DIMS_I, DIMS_J) \
{ \
do { \
/* Prefix with h5taa to avoid shadow warnings */ \
size_t h5taa_pointers_size = 0; \
size_t h5taa_data_size = 0; \
@ -167,10 +167,10 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
\
for (h5taa_i = 1; h5taa_i < (DIMS_I); h5taa_i++) \
ARR[h5taa_i] = ARR[h5taa_i-1] + (DIMS_J); \
}
} while(0)
#define H5TEST_FILL_2D_ARRAY(ARR, TYPE, DIMS_I, DIMS_J) \
{ \
do { \
/* Prefix with h5tfa to avoid shadow warnings */ \
int h5tfa_i = 0; \
int h5tfa_j = 0; \
@ -181,7 +181,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
ARR[h5tfa_i][h5tfa_j] = h5tfa_count; \
h5tfa_count++; \
} \
}
} while(0)
#ifdef __cplusplus

View File

@ -792,24 +792,20 @@ xml_escape_the_string(const char *str, int slen)
esc_len = 1;
}
else if (*cp == '\'') {
HDstrncpy(ncp, apos, ncp_len);
esc_len = HDstrlen(apos);
HDstrncpy(ncp, apos, esc_len);
ncp[sizeof(ncp) - 1] = '\0';
}
else if (*cp == '<') {
HDstrncpy(ncp, lt, ncp_len);
esc_len = HDstrlen(lt);
HDstrncpy(ncp, lt, esc_len);
ncp[sizeof(ncp) - 1] = '\0';
}
else if (*cp == '>') {
HDstrncpy(ncp, gt, ncp_len);
esc_len = HDstrlen(gt);
HDstrncpy(ncp, gt, esc_len);
ncp[sizeof(ncp) - 1] = '\0';
}
else if (*cp == '&') {
HDstrncpy(ncp, amp, ncp_len);
esc_len = HDstrlen(amp);
HDstrncpy(ncp, amp, esc_len);
ncp[sizeof(ncp) - 1] = '\0';
}
else {
*ncp = *cp;