]> mj.ucw.cz Git - libucw.git/blob - lib/alloc_str.c
When pre-sorting a regular file, use lib/arraysort.h on an array of items
[libucw.git] / lib / alloc_str.c
1 /*
2  *      Sherlock Library -- String Allocation
3  *
4  *      (c) 1997 Martin Mares <mj@ucw.cz>
5  *
6  *      This software may be freely distributed and used according to the terms
7  *      of the GNU Lesser General Public License.
8  */
9
10 #include "lib/lib.h"
11
12 #include <string.h>
13
14 byte *
15 stralloc(byte *s)
16 {
17   uns l = strlen(s);
18   byte *k = xmalloc(l + 1);
19   strcpy(k, s);
20   return k;
21 }