diff --git a/hdf/src/hdfalloc.c b/hdf/src/hdfalloc.c index 8cd0fe7095..d2bdffa8e1 100644 --- a/hdf/src/hdfalloc.c +++ b/hdf/src/hdfalloc.c @@ -118,40 +118,3 @@ HIstrncpy(char *dest, const char *source, intn len) *dest = '\0'; /* Force the last byte be '\0' */ return (destp); } /* end HIstrncpy() */ -/* *INDENT-OFF* */ -/* GNU indent 1.9.1 urps on this section, so turn off indenting for now -QAK */ - -/*-------------------------------------------------------------------------- - NAME - strdup -- in-library replacement for non-ANSI strdup() - USAGE - char *strdup(s) - const char *s; IN: pointer to the string to duplicate - RETURNS - Pointer to the duplicated string, or NULL on failure. - DESCRIPTION - Duplicates a string (i.e. allocates space and copies it over). - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - Acts like strdup(). - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -char * -strdup(const char *s) -{ - char *ret; - - /* Make sure original string is not NULL */ - if (s == NULL) - return (NULL); - - /* Allocate space */ - ret = (char *)malloc((uint32)strlen(s) + 1); - if (ret == NULL) - return (NULL); - - /* Copy the original string and return it */ - strcpy(ret, s); - return (ret); -} /* end strdup() */ diff --git a/hdf/src/hproto.h b/hdf/src/hproto.h index 516c99b146..768aa3f9d8 100644 --- a/hdf/src/hproto.h +++ b/hdf/src/hproto.h @@ -324,8 +324,6 @@ HDFLIBAPI char *HIstrncpy(char *dest, const char *source, intn len); HDFLIBAPI int32 HDspaceleft(void); -HDFPUBLIC char *strdup(const char *s); - HDFLIBAPI intn HDc2fstr(char *str, intn len); HDFLIBAPI char *HDf2cstring(_fcd fdesc, intn len);