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