summaryrefslogtreecommitdiff
path: root/src/builtins
diff options
context:
space:
mode:
Diffstat (limited to 'src/builtins')
-rw-r--r--src/builtins/dir.c19
-rw-r--r--src/builtins/file.c6
-rw-r--r--src/builtins/render.c4
3 files changed, 10 insertions, 19 deletions
diff --git a/src/builtins/dir.c b/src/builtins/dir.c
index dd2ea1a..bf351b1 100644
--- a/src/builtins/dir.c
+++ b/src/builtins/dir.c
@@ -1,6 +1,4 @@
/*
- * Id: dir.c,v 1.2 1999/11/02 06:16:47 keithp Exp $
- *
* Copyright 1999 SuSE, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -22,7 +20,6 @@
*
* Author: Keith Packard, SuSE, Inc.
*/
-/* $XFree86: xc/lib/font/builtins/dir.c,v 1.3 1999/12/30 02:29:49 robin Exp $ */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -39,17 +36,13 @@ BuiltinDirsDup (const BuiltinDirPtr a_dirs,
if (!a_dirs)
return NULL ;
- dirs = xcalloc (a_dirs_len, sizeof (BuiltinDirRec)) ;
+ dirs = calloc (a_dirs_len, sizeof (BuiltinDirRec)) ;
if (!dirs)
return NULL ;
for (i=0; i < a_dirs_len; i++) {
- int len = strlen (a_dirs[i].file_name) ;
- dirs[i].file_name = xcalloc (1, len+1) ;
- memmove (dirs[i].file_name, a_dirs[i].file_name, len);
- len = strlen (a_dirs[i].font_name) ;
- dirs[i].font_name = xcalloc (1, len+1) ;
- memmove (dirs[i].font_name, a_dirs[i].font_name, len);
+ dirs[i].file_name = strdup(a_dirs[i].file_name);
+ dirs[i].font_name = strdup(a_dirs[i].font_name);
}
return dirs ;
}
@@ -104,14 +97,12 @@ BuiltinAliasesDup (const BuiltinAliasPtr a_aliases,
if (!a_aliases)
return NULL ;
- aliases = xcalloc (a_aliases_len, sizeof (BuiltinAliasRec)) ;
+ aliases = calloc (a_aliases_len, sizeof (BuiltinAliasRec)) ;
if (!aliases)
return NULL ;
for (i=0; i < a_aliases_len; i++) {
- int len = strlen (a_aliases[i].font_name) ;
- aliases[i].font_name = xcalloc (1, len+1) ;
- memmove (aliases[i].font_name, a_aliases[i].font_name, len);
+ aliases[i].font_name = strdup(a_aliases[i].font_name);
}
return aliases ;
}
diff --git a/src/builtins/file.c b/src/builtins/file.c
index a46b0a6..f08f67f 100644
--- a/src/builtins/file.c
+++ b/src/builtins/file.c
@@ -87,7 +87,7 @@ BuiltinClose (BufFilePtr f, int unused)
{
BuiltinIOPtr io = ((BuiltinIOPtr) f->private);
- xfree (io);
+ free (io);
return 1;
}
@@ -105,7 +105,7 @@ BuiltinFileOpen (char *name)
break;
if (i == builtin_files_count)
return NULL;
- io = (BuiltinIOPtr) xalloc (sizeof (BuiltinIORec));
+ io = malloc (sizeof (BuiltinIORec));
if (!io)
return NULL;
io->offset = 0;
@@ -113,7 +113,7 @@ BuiltinFileOpen (char *name)
raw = BufFileCreate ((char *) io, BuiltinFill, 0, BuiltinSkip, BuiltinClose);
if (!raw)
{
- xfree (io);
+ free (io);
return NULL;
}
if ((cooked = BufFilePushZIP (raw)))
diff --git a/src/builtins/render.c b/src/builtins/render.c
index 871665f..52c24b9 100644
--- a/src/builtins/render.c
+++ b/src/builtins/render.c
@@ -50,7 +50,7 @@ BuiltinOpenBitmap (FontPathElementPtr fpe, FontPtr *ppFont, int flags,
file = BuiltinFileOpen (fileName);
if (!file)
return BadFontName;
- pFont = (FontPtr) xalloc(sizeof(FontRec));
+ pFont = malloc(sizeof(FontRec));
if (!pFont) {
BuiltinFileClose (file, 0);
return AllocError;
@@ -69,7 +69,7 @@ BuiltinOpenBitmap (FontPathElementPtr fpe, FontPtr *ppFont, int flags,
BuiltinFileClose (file, 0);
if (ret != Successful)
- xfree(pFont);
+ free(pFont);
else
*ppFont = pFont;
return ret;