diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2013-02-25 14:48:42 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2013-02-25 14:48:42 (GMT) |
commit | 0fc1c9c5197d9d762ef6753f299d6ad7221f72a8 (patch) | |
tree | 4d5e5e3c1b6ae426ab46137907af39d683e0054f /src | |
parent | 66ba0b4f3309188dfd8e9b5c969dcca0014b8526 (diff) | |
download | hdf5-0fc1c9c5197d9d762ef6753f299d6ad7221f72a8.zip hdf5-0fc1c9c5197d9d762ef6753f299d6ad7221f72a8.tar.gz hdf5-0fc1c9c5197d9d762ef6753f299d6ad7221f72a8.tar.bz2 |
[svn-r23313] Description:
Bring changes from Coverity branch to the trunk:
r20612:
Changed string functions to versions with string length to fix coverity issues
922, 942 and 943.
r20614:
Use HDsnprintf. --gh
r20675:
Fix for coverity #1714 due to the fix for #810.
Use HDfree() instead of H5MM_xfree().
r20678:
Repaired coverity issue #598 -- failure to check return value from a
call to fstat(), or to tidy up in the event of failure.
r20679:
Use HDstrncpy. --gh
r20681:
Use HDstrncat and HDstrncpy. --gh
Tested on:
Mac OSX/64 10.8.2 (amazon) w/Debug, etc.
(too minor to require h5committest)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FDstdio.c | 23 | ||||
-rw-r--r-- | src/H5HFdbg.c | 18 | ||||
-rw-r--r-- | src/H5Lexternal.c | 47 | ||||
-rw-r--r-- | src/H5Ocopy.c | 2 | ||||
-rw-r--r-- | src/H5Oname.c | 12 | ||||
-rw-r--r-- | src/H5T.c | 4 | ||||
-rw-r--r-- | src/H5private.h | 55 | ||||
-rw-r--r-- | src/H5system.c | 12 |
8 files changed, 97 insertions, 76 deletions
diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 4e484c2..8f4f7f0 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -415,23 +415,36 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, /* Get the file descriptor (needed for truncate and some Windows information) */ file->fd = fileno(file->fp); - if(file->fd < 0) + if(file->fd < 0) { + free(file); + fclose(f); H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTOPENFILE, "unable to get file descriptor", NULL); + } /* end if */ #ifdef H5_HAVE_WIN32_API file->hFile = (HANDLE)_get_osfhandle(file->fd); - if(INVALID_HANDLE_VALUE == file->hFile) + if(INVALID_HANDLE_VALUE == file->hFile) { + free(file); + fclose(f); H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTOPENFILE, "unable to get Windows file handle", NULL); + } /* end if */ - if(!GetFileInformationByHandle((HANDLE)file->hFile, &fileinfo)) - H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTOPENFILE, "unable to get Windows file desinformationcriptor", NULL); + if(!GetFileInformationByHandle((HANDLE)file->hFile, &fileinfo)) { + free(file); + fclose(f); + H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTOPENFILE, "unable to get Windows file descriptor information", NULL); + } /* end if */ file->nFileIndexHigh = fileinfo.nFileIndexHigh; file->nFileIndexLow = fileinfo.nFileIndexLow; file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber; #else /* H5_HAVE_WIN32_API */ - fstat(file->fd, &sb); + if(fstat(file->fd, &sb) < 0) { + free(file); + fclose(f); + H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADFILE, "unable to fstat file", NULL) + } /* end if */ file->device = sb.st_dev; #ifdef H5_VMS file->inode[0] = sb.st_ino[0]; diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 76c7b96..5d68fd1 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -187,7 +187,7 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi void H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t dump_internal, FILE *stream, int indent, int fwidth) { - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -381,7 +381,7 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata) size_t start, end; /* Start & end of the overlapping area */ size_t len; /* Length of the overlapping area */ size_t overlap; /* Track any overlaps */ - unsigned u; /* Local index variable */ + size_t u; /* Local index variable */ /* Calculate the starting & ending */ if(sect_start < dblock_start) @@ -396,7 +396,7 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata) /* Calculate the length */ len = end - start; - sprintf(temp_str, "Section #%u:", (unsigned)udata->sect_count); + HDsnprintf(temp_str, sizeof(temp_str), "Section #%u:", (unsigned)udata->sect_count); HDfprintf(udata->stream, "%*s%-*s %8Zu, %8Zu\n", udata->indent + 3, "", MAX(0, udata->fwidth - 9), temp_str, start, len); @@ -530,7 +530,7 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, HDfprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth, "Percent of available space for data used:", - (100.0 * (double)((dblock->size - blk_prefix_size) - amount_free) / (double)(dblock->size - blk_prefix_size))); + ((double)100.0f * (double)((dblock->size - blk_prefix_size) - amount_free) / (double)(dblock->size - blk_prefix_size))); /* * Print the data in a VMS-style octal dump. @@ -569,7 +569,7 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, char temp_str[64]; /* Temporary string, for formatting */ size_t u, v; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -614,13 +614,13 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, else HDfprintf(stream, "%*sDirect Block Entries: (address)\n", indent, ""); for(u = 0; u < hdr->man_dtable.max_direct_rows && u < iblock->nrows; u++) { - sprintf(temp_str, "Row #%u: (block size: %lu)", (unsigned)u, (unsigned long)hdr->man_dtable.row_block_size[u]); + HDsnprintf(temp_str, sizeof(temp_str), "Row #%u: (block size: %lu)", (unsigned)u, (unsigned long)hdr->man_dtable.row_block_size[u]); HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); for(v = 0; v < hdr->man_dtable.cparam.width; v++) { size_t off = (u * hdr->man_dtable.cparam.width) + v; - sprintf(temp_str, "Col #%u:", (unsigned)v); + HDsnprintf(temp_str, sizeof(temp_str), "Col #%u:", (unsigned)v); if(hdr->filter_len > 0) HDfprintf(stream, "%*s%-*s %9a/%6Zu/%x\n", indent + 6, "", MAX(0, fwidth - 6), temp_str, @@ -642,13 +642,13 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, H5V_log2_of2(hdr->man_dtable.cparam.width); for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++) { num_indirect_rows = (H5V_log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1; - sprintf(temp_str, "Row #%u: (# of rows: %u)", (unsigned)u, num_indirect_rows); + HDsnprintf(temp_str, sizeof(temp_str), "Row #%u: (# of rows: %u)", (unsigned)u, num_indirect_rows); HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); for(v = 0; v < hdr->man_dtable.cparam.width; v++) { size_t off = (u * hdr->man_dtable.cparam.width) + v; - sprintf(temp_str, "Col #%u:", (unsigned)v); + HDsnprintf(temp_str, sizeof(temp_str), "Col #%u:", (unsigned)v); HDfprintf(stream, "%*s%-*s %9a\n", indent + 6, "", MAX(0, fwidth - 6), temp_str, iblock->ents[off].addr); diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 62e7a5e..a1245ba 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -102,7 +102,7 @@ H5L_getenv_prefix_name(char **env_prefix/*in,out*/) FUNC_ENTER_NOAPI_NOINIT_NOERR - strret = HDstrchr(*env_prefix, COLON_SEPC); + strret = HDstrchr(*env_prefix, H5_COLON_SEPC); if (strret == NULL) { retptr = *env_prefix; *env_prefix = strret; @@ -144,14 +144,9 @@ H5L_build_name(char *prefix, char *file_name, char **full_name/*out*/) if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") - /* Copy the prefix into the buffer */ - HDstrcpy(*full_name, prefix); - - if (!CHECK_DELIMITER(prefix[prefix_len-1])) - HDstrcat(*full_name, DIR_SEPS); - - /* Add the external link's filename to the prefix supplied */ - HDstrcat(*full_name, file_name); + /* Compose the full file name */ + HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix, + (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name); done: FUNC_LEAVE_NOAPI(ret_value) @@ -319,24 +314,32 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* target file_name is an absolute pathname: see RM for detailed description */ - if(CHECK_ABSOLUTE(file_name) || CHECK_ABS_PATH(file_name)) { + if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { /* Try opening file */ if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, H5AC_dxpl_id))) { - char *ptr = NULL; + char *ptr; H5E_clear_stack(NULL); /* get last component of file_name */ - GET_LAST_DELIMITER(file_name, ptr) + H5_GET_LAST_DELIMITER(file_name, ptr) HDassert(ptr); - HDstrcpy(temp_file_name, ++ptr); + + /* Increment past delimiter */ + ptr++; + + /* Copy into the temp. file name */ + HDstrncpy(temp_file_name, ptr, HDstrlen(ptr) + 1); } /* end if */ } /* end if */ - else if(CHECK_ABS_DRIVE(file_name)) { + else if(H5_CHECK_ABS_DRIVE(file_name)) { + /* Try opening file */ if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, H5AC_dxpl_id))) { + H5E_clear_stack(NULL); + /* strip "<drive-letter>:" */ - HDstrcpy(temp_file_name, &file_name[2]); + HDstrncpy(temp_file_name, &file_name[2], (HDstrlen(file_name) - 2) + 1); } /* end if */ } /* end if */ @@ -414,7 +417,7 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, HGOTO_ERROR(H5E_LINK, H5E_CANTALLOC, FAIL, "can't duplicate resolved file name string") /* get last component of file_name */ - GET_LAST_DELIMITER(actual_file_name, ptr) + H5_GET_LAST_DELIMITER(actual_file_name, ptr) if(!ptr) HGOTO_ERROR(H5E_LINK, H5E_CANTOPENFILE, FAIL, "unable to open external file, external link file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) @@ -543,6 +546,8 @@ H5Lcreate_external(const char *file_name, const char *obj_name, char *norm_obj_name = NULL; /* Pointer to normalized current name */ void *ext_link_buf = NULL; /* Buffer to contain external link */ size_t buf_size; /* Size of buffer to hold external link */ + size_t file_name_len; /* Length of file name string */ + size_t norm_obj_name_len; /* Length of normalized object name string */ uint8_t *p; /* Pointer into external link buffer */ herr_t ret_value = SUCCEED; /* Return value */ @@ -565,16 +570,18 @@ H5Lcreate_external(const char *file_name, const char *obj_name, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "can't normalize object name") /* Combine the filename and link name into a single buffer to give to the UD link */ - buf_size = 1 + (HDstrlen(file_name) + 1) + (HDstrlen(norm_obj_name) + 1); + file_name_len = HDstrlen(file_name) + 1; + norm_obj_name_len = HDstrlen(norm_obj_name) + 1; + buf_size = 1 + file_name_len + norm_obj_name_len; if(NULL == (ext_link_buf = H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate udata buffer") /* Encode the external link information */ p = (uint8_t *)ext_link_buf; *p++ = (H5L_EXT_VERSION << 4) | H5L_EXT_FLAGS_ALL; /* External link version & flags */ - HDstrcpy((char *)p, file_name); /* Name of file containing external link's object */ - p += HDstrlen(file_name) + 1; - HDstrcpy((char *)p, norm_obj_name); /* External link's object */ + HDstrncpy((char *)p, file_name, file_name_len); /* Name of file containing external link's object */ + p += file_name_len; + HDstrncpy((char *)p, norm_obj_name, norm_obj_name_len); /* External link's object */ /* Create an external link */ if(H5L_create_ud(&link_loc, link_name, ext_link_buf, buf_size, H5L_TYPE_EXTERNAL, lcpl_id, lapl_id, H5AC_dxpl_id) < 0) diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index f643842..dc79e47 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -1245,7 +1245,7 @@ H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc, new_oloc.addr = dst_oloc->addr; /* Pick a default name for the new object */ - sprintf(tmp_obj_name, "~obj_pointed_by_%llu", (unsigned long long)dst_oloc->addr); + HDsnprintf(tmp_obj_name, sizeof(tmp_obj_name), "~obj_pointed_by_%llu", (unsigned long long)dst_oloc->addr); /* Create a link to the newly copied object */ /* Note: since H5O_copy_header_map actually copied the target object, it diff --git a/src/H5Oname.c b/src/H5Oname.c index fb44000..c1cb8c8 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -97,10 +97,10 @@ H5O_name_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, HDassert(p); /* decode */ - if(NULL == (mesg = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t))) || - NULL == (mesg->s = (char *)H5MM_malloc(HDstrlen((const char *)p) + 1))) + if(NULL == (mesg = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + if(NULL == (mesg->s = (char *)H5MM_strdup((const char *)p))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - HDstrcpy(mesg->s, (const char *)p); /* Set return value */ ret_value = mesg; @@ -138,9 +138,9 @@ H5O_name_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, cons FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(p); - assert(mesg && mesg->s); + HDassert(f); + HDassert(p); + HDassert(mesg && mesg->s); /* encode */ HDstrcpy((char*)p, mesg->s); @@ -4389,7 +4389,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, H5T_g.apaths = 128; if(NULL == (H5T_g.path[0] = H5FL_CALLOC(H5T_path_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for no-op conversion path") - HDstrcpy(H5T_g.path[0]->name, "no-op"); + HDsnprintf(H5T_g.path[0]->name, sizeof(H5T_g.path[0]->name), "no-op"); H5T_g.path[0]->func = H5T__conv_noop; H5T_g.path[0]->cdata.command = H5T_CONV_INIT; if(H5T__conv_noop(FAIL, FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { @@ -4457,7 +4457,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, path->name[H5T_NAMELEN - 1] = '\0'; } /* end if */ else - HDstrcpy(path->name, "NONAME"); + HDsnprintf(path->name, sizeof(path->name), "NONAME"); if(NULL == (path->src = H5T_copy(src, H5T_COPY_ALL))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy datatype for conversion path") if(NULL == (path->dst = H5T_copy(dst, H5T_COPY_ALL))) diff --git a/src/H5private.h b/src/H5private.h index bff4e59..44dd01b 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1473,19 +1473,20 @@ extern char *strdup(const char *s); #if defined(H5_HAVE_WINDOW_PATH) /* directory delimiter for Windows: slash and backslash are acceptable on Windows */ -#define DIR_SLASH_SEPC '/' -#define DIR_SEPC '\\' -#define DIR_SEPS "\\" -#define CHECK_DELIMITER(SS) ((SS == DIR_SEPC)||(SS == DIR_SLASH_SEPC)) -#define CHECK_ABSOLUTE(NAME) ((isalpha(NAME[0])) && (NAME[1] == ':') && (CHECK_DELIMITER(NAME[2]))) -#define CHECK_ABS_DRIVE(NAME) ((isalpha(NAME[0])) && (NAME[1] == ':')) -#define CHECK_ABS_PATH(NAME) (CHECK_DELIMITER(NAME[0])) - -#define GET_LAST_DELIMITER(NAME, ptr) { \ +#define H5_DIR_SLASH_SEPC '/' +#define H5_DIR_SEPC '\\' +#define H5_DIR_SEPS "\\" +#define H5_CHECK_DELIMITER(SS) ((SS == H5_DIR_SEPC) || (SS == H5_DIR_SLASH_SEPC)) +#define H5_CHECK_ABSOLUTE(NAME) ((HDisalpha(NAME[0])) && (NAME[1] == ':') && (H5_CHECK_DELIMITER(NAME[2]))) +#define H5_CHECK_ABS_DRIVE(NAME) ((HDisalpha(NAME[0])) && (NAME[1] == ':')) +#define H5_CHECK_ABS_PATH(NAME) (H5_CHECK_DELIMITER(NAME[0])) + +#define H5_GET_LAST_DELIMITER(NAME, ptr) { \ char *slash, *backslash; \ - slash = strrchr(NAME, DIR_SLASH_SEPC); \ - backslash = strrchr(NAME, DIR_SEPC); \ - if (backslash > slash) \ + \ + slash = HDstrrchr(NAME, H5_DIR_SLASH_SEPC); \ + backslash = HDstrrchr(NAME, H5_DIR_SEPC); \ + if(backslash > slash) \ (ptr = backslash); \ else \ (ptr = slash); \ @@ -1495,27 +1496,27 @@ extern char *strdup(const char *s); /* OpenVMS pathname: <disk name>$<partition>:[path]<file name> * i.g. SYS$SYSUSERS:[LU.HDF5.SRC]H5system.c */ -#define DIR_SEPC ']' -#define DIR_SEPS "]" -#define CHECK_DELIMITER(SS) (SS == DIR_SEPC) -#define CHECK_ABSOLUTE(NAME) (strrchr(NAME, ':') && strrchr(NAME, '[')) -#define CHECK_ABS_DRIVE(NAME) (0) -#define CHECK_ABS_PATH(NAME) (0) -#define GET_LAST_DELIMITER(NAME, ptr) ptr = strrchr(NAME, DIR_SEPC); +#define H5_DIR_SEPC ']' +#define H5_DIR_SEPS "]" +#define H5_CHECK_DELIMITER(SS) (SS == H5_DIR_SEPC) +#define H5_CHECK_ABSOLUTE(NAME) (HDstrrchr(NAME, ':') && HDstrrchr(NAME, '[')) +#define H5_CHECK_ABS_DRIVE(NAME) (0) +#define H5_CHECK_ABS_PATH(NAME) (0) +#define H5_GET_LAST_DELIMITER(NAME, ptr) ptr = HDstrrchr(NAME, H5_DIR_SEPC); #else -#define DIR_SEPC '/' -#define DIR_SEPS "/" -#define CHECK_DELIMITER(SS) (SS == DIR_SEPC) -#define CHECK_ABSOLUTE(NAME) (CHECK_DELIMITER(*NAME)) -#define CHECK_ABS_DRIVE(NAME) (0) -#define CHECK_ABS_PATH(NAME) (0) -#define GET_LAST_DELIMITER(NAME, ptr) ptr = strrchr(NAME, DIR_SEPC); +#define H5_DIR_SEPC '/' +#define H5_DIR_SEPS "/" +#define H5_CHECK_DELIMITER(SS) (SS == H5_DIR_SEPC) +#define H5_CHECK_ABSOLUTE(NAME) (H5_CHECK_DELIMITER(*NAME)) +#define H5_CHECK_ABS_DRIVE(NAME) (0) +#define H5_CHECK_ABS_PATH(NAME) (0) +#define H5_GET_LAST_DELIMITER(NAME, ptr) ptr = HDstrrchr(NAME, H5_DIR_SEPC); #endif -#define COLON_SEPC ':' +#define H5_COLON_SEPC ':' /* Use FUNC to safely handle variations of C99 __func__ keyword handling */ diff --git a/src/H5system.c b/src/H5system.c index 83cecba..3ffe411 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -707,7 +707,7 @@ H5_build_extpath(const char *name, char **extpath/*out*/) * OpenVMS: <disk name>$<partition>:[path]<file name> * i.g. SYS$SYSUSERS:[LU.HDF5.SRC]H5system.c */ - if(CHECK_ABSOLUTE(name)) { + if(H5_CHECK_ABSOLUTE(name)) { if(NULL == (full_path = (char *)H5MM_strdup(name))) HGOTO_ERROR(H5E_INTERNAL, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end if */ @@ -726,7 +726,7 @@ H5_build_extpath(const char *name, char **extpath/*out*/) * Unix: does not apply * OpenVMS: does not apply */ - if(CHECK_ABS_DRIVE(name)) { + if(H5_CHECK_ABS_DRIVE(name)) { drive = name[0] - 'A' + 1; retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN); HDstrcpy(new_name, &name[2]); @@ -737,7 +737,7 @@ H5_build_extpath(const char *name, char **extpath/*out*/) * Unix: does not apply * OpenVMS: does not apply */ - else if(CHECK_ABS_PATH(name) && (0 != (drive = HDgetdrive()))) { + else if(H5_CHECK_ABS_PATH(name) && (0 != (drive = HDgetdrive()))) { sprintf(cwdpath, "%c:%c", (drive+'A'-1), name[0]); retcwd = cwdpath; HDstrcpy(new_name, &name[1]); @@ -773,8 +773,8 @@ H5_build_extpath(const char *name, char **extpath/*out*/) else HDstrncat(full_path, new_name, HDstrlen(new_name)); #else - if(!CHECK_DELIMITER(cwdpath[cwdlen - 1])) - HDstrncat(full_path, DIR_SEPS, HDstrlen(DIR_SEPS)); + if(!H5_CHECK_DELIMITER(cwdpath[cwdlen - 1])) + HDstrncat(full_path, H5_DIR_SEPS, HDstrlen(H5_DIR_SEPS)); HDstrncat(full_path, new_name, HDstrlen(new_name)); #endif } /* end if */ @@ -784,7 +784,7 @@ H5_build_extpath(const char *name, char **extpath/*out*/) if(full_path) { char *ptr = NULL; - GET_LAST_DELIMITER(full_path, ptr) + H5_GET_LAST_DELIMITER(full_path, ptr) HDassert(ptr); *++ptr = '\0'; *extpath = full_path; |