aboutsummaryrefslogtreecommitdiff
path: root/libXfont/src/fontfile
diff options
context:
space:
mode:
Diffstat (limited to 'libXfont/src/fontfile')
-rw-r--r--libXfont/src/fontfile/fontdir.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/libXfont/src/fontfile/fontdir.c b/libXfont/src/fontfile/fontdir.c
index 97b2ba3b1..ef7ffa561 100644
--- a/libXfont/src/fontfile/fontdir.c
+++ b/libXfont/src/fontfile/fontdir.c
@@ -425,17 +425,13 @@ FontFileCountDashes (char *name, int namelen)
return ndashes;
}
+/* exported in public API in <X11/fonts/fntfil.h> */
char *
FontFileSaveString (char *s)
{
- char *n;
-
- n = malloc (strlen (s) + 1);
- if (!n)
- return 0;
- strcpy (n, s);
- return n;
+ return strdup(s);
}
+#define FontFileSaveString(s) strdup(s)
FontEntryPtr
FontFileFindNameInScalableDir(FontTablePtr table, FontNamePtr pat,