[PATCH:libXfont 1/2] xstrdup -> strdup

Alan Coopersmith alan.coopersmith at oracle.com
Wed Oct 30 02:55:07 CET 2013


Missed in xalloc -> malloc etal conversion in 0cdc9b8f850342

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 src/FreeType/ftfuncs.c |    4 ++--
 src/FreeType/xttcap.c  |   20 --------------------
 src/FreeType/xttcap.h  |    9 ---------
 3 files changed, 2 insertions(+), 31 deletions(-)

diff --git a/src/FreeType/ftfuncs.c b/src/FreeType/ftfuncs.c
index 918e3f3..091339d 100644
--- a/src/FreeType/ftfuncs.c
+++ b/src/FreeType/ftfuncs.c
@@ -2204,7 +2204,7 @@ FreeTypeSetUpTTCap( char *fileName, FontScalablePtr vals,
 		strcpy(*dynStrRealFileName+dirLen, p2+1);
 		capHead = p1;
 	    } else {
-		*dynStrRealFileName = xstrdup(fileName);
+		*dynStrRealFileName = strdup(fileName);
 		if( *dynStrRealFileName == NULL ) {
 		    result = AllocError;
 		    goto quit;
@@ -2549,7 +2549,7 @@ FreeTypeSetUpTTCap( char *fileName, FontScalablePtr vals,
     if (SPropRecValList_search_record(&listPropRecVal,
 				      &contRecValue,
 				      "CodeRange")) {
-	*dynStrTTCapCodeRange = xstrdup(SPropContainer_value_str(contRecValue));
+	*dynStrTTCapCodeRange = strdup(SPropContainer_value_str(contRecValue));
 	if( *dynStrTTCapCodeRange == NULL ) {
 	    result = AllocError;
 	    goto quit;
diff --git a/src/FreeType/xttcap.c b/src/FreeType/xttcap.c
index bf25cc5..c1d8e67 100644
--- a/src/FreeType/xttcap.c
+++ b/src/FreeType/xttcap.c
@@ -682,24 +682,4 @@ SPropRecValList_add_by_font_cap(SDynPropRecValList *pThisList,
     return result;
 }
 
-
-/**************************************************************************
-  Functions (xttmisc)
- */
-
-/* strdup clone with using the allocator of X server */
-char *
-XttXstrdup(char const *str)
-{
-    char *result;
-
-    result = malloc(strlen(str)+1);
-
-    if (result)
-        strcpy(result, str);
-
-    return result;
-}
-
-
 /* end of file */
diff --git a/src/FreeType/xttcap.h b/src/FreeType/xttcap.h
index 2931098..2822540 100644
--- a/src/FreeType/xttcap.h
+++ b/src/FreeType/xttcap.h
@@ -116,15 +116,6 @@ SPropRecValList_dump(SRefPropRecValList *refList);
 #define SPropContainer_value_str(contRecVal)\
   ((contRecVal)->uValue.dynStringValue)
 
-/******************************************************
-  Prototypes (xttmisc)
- */
-
-/* strdup clone */
-char * XttXstrdup(char const *str);
-#undef xstrdup
-#define xstrdup(s) XttXstrdup((char const*)s)
-
 #endif /* !def _XTTCAP_H_ */
 
 /* end of file */
-- 
1.7.9.2



More information about the xorg-devel mailing list