/*
- * $XFree86: xc/lib/fontconfig/src/fcstr.c,v 1.7 2002/07/13 05:43:25 keithp Exp $
+ * $XFree86: xc/lib/fontconfig/src/fcstr.c,v 1.10 2002/08/31 22:17:32 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
if ((b & 0xfc00) != 0xdc00)
return 0;
result = ((((FcChar32) a & 0x3ff) << 10) |
- ((FcChar32) b & 0x3ff)) | 0x10000;
+ ((FcChar32) b & 0x3ff)) + 0x10000;
}
else
result = a;
{
if (buf->allocated)
{
+ FcMemFree (FC_MEM_STRBUF, buf->size);
free (buf->buf);
FcStrBufInit (buf, 0, 0);
}
ret = malloc (buf->len + 1);
if (ret)
{
+ FcMemAlloc (FC_MEM_STRING, buf->len + 1);
memcpy (ret, buf->buf, buf->len);
ret[buf->len] = '\0';
}
buf->failed = FcTrue;
return FcFalse;
}
+ if (buf->size)
+ FcMemFree (FC_MEM_STRBUF, buf->size);
+ FcMemAlloc (FC_MEM_STRBUF, size);
buf->size = size;
buf->buf = new;
}
if (*s == '~')
{
FcChar8 *home = (FcChar8 *) getenv ("HOME");
- int size = strlen ((char *) home) + strlen ((char *) s);
+ int size;
if (!home)
return 0;
+ size = strlen ((char *) home) + strlen ((char *) s);
new = (FcChar8 *) malloc (size);
if (!new)
return 0;