]> mj.ucw.cz Git - libucw.git/blobdiff - lib/alloc_str.c
Adapted to new unicode includes.
[libucw.git] / lib / alloc_str.c
index 2b03eb2cdc952ee1daf3061f1bc6e9e99be72957..45ea49125d9eb85ed5d4f16276e5ba644a9bcdbe 100644 (file)
 #include <string.h>
 
 byte *
-stralloc(byte *s)
+xstrdup(byte *s)
 {
-  uns l = strlen(s);
-  byte *k = xmalloc(l + 1);
-  strcpy(k, s);
-  return k;
+  uns l = strlen(s) + 1;
+  return memcpy(xmalloc(l), s, l);
 }