]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcstr.c
FcStat: change to FcChar8 for first arg
[fontconfig.git] / src / fcstr.c
index 34115ce86a264aa3c710c2e91c02afed96435ca5..b712e5dafd52e698f52defbcb88ba658241c1bc1 100644 (file)
@@ -7,9 +7,9 @@
  * documentation for any purpose is hereby granted without fee, provided that
  * the above copyright notice appear in all copies and that both that
  * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
+ * documentation, and that the name of the author(s) not be used in
  * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  Keith Packard makes no
+ * specific, written prior permission.  The authors make no
  * representations about the suitability of this software for any purpose.  It
  * is provided "as is" without express or implied warranty.
  *
@@ -50,14 +50,16 @@ FcStrCopy (const FcChar8 *s)
 FcChar8 *
 FcStrPlus (const FcChar8 *s1, const FcChar8 *s2)
 {
-    int            l = strlen ((char *)s1) + strlen ((char *) s2) + 1;
+    int            s1l = strlen ((char *) s1);
+    int            s2l = strlen ((char *) s2);
+    int            l = s1l + s2l + 1;
     FcChar8 *s = malloc (l);
 
     if (!s)
        return 0;
     FcMemAlloc (FC_MEM_STRING, l);
-    strcpy ((char *) s, (char *) s1);
-    strcat ((char *) s, (char *) s2);
+    memcpy (s, s1, s1l);
+    memcpy (s + s1l, s2, s2l + 1);
     return s;
 }