Signed-off-by: Alan Coopersmith <[email protected]>
---
hw/dmx/dmxinit.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c
index b950c50..9a60bf3 100644
--- a/hw/dmx/dmxinit.c
+++ b/hw/dmx/dmxinit.c
@@ -802,18 +802,15 @@ void InitOutput(ScreenInfo *pScreenInfo, int argc, char
*argv[])
strcpy. */
static void dmxSetDefaultFontPath(char *fp)
{
- int fplen = strlen(fp) + 1;
-
if (dmxFontPath) {
- int len;
+ int fplen = strlen(fp) + 1;
+ int len = strlen(dmxFontPath);
- len = strlen(dmxFontPath);
dmxFontPath = realloc(dmxFontPath, len+fplen+1);
dmxFontPath[len] = ',';
strncpy(&dmxFontPath[len+1], fp, fplen);
} else {
- dmxFontPath = malloc(fplen);
- strncpy(dmxFontPath, fp, fplen);
+ dmxFontPath = strdup(fp);
}
defaultFontPath = dmxFontPath;
--
1.7.3.2
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel