]> mj.ucw.cz Git - libucw.git/blob - lib/alloc_str.c
baf5f5adf94cfc844da495e49de1b95dd6055e58
[libucw.git] / lib / alloc_str.c
1 /*
2  *      Sherlock Library -- String Allocation
3  *
4  *      (c) 1997 Martin Mares <mj@ucw.cz>
5  */
6
7 #include "lib/lib.h"
8
9 #include <string.h>
10
11 byte *
12 stralloc(byte *s)
13 {
14   uns l = strlen(s);
15   byte *k = xmalloc(l + 1);
16   strcpy(k, s);
17   return k;
18 }