From: Martin Mares Date: Mon, 10 May 2004 14:10:12 +0000 (+0000) Subject: Renamed stralloc() to xstrdup() to be consistent with libc terminology X-Git-Tag: holmes-import~1069 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=f409090ae7a4ca4f7710c8306948177fdcb49613;p=libucw.git Renamed stralloc() to xstrdup() to be consistent with libc terminology and also with mp_strdup(). --- diff --git a/lib/alloc_str.c b/lib/alloc_str.c index 2b03eb2c..45ea4912 100644 --- a/lib/alloc_str.c +++ b/lib/alloc_str.c @@ -12,10 +12,8 @@ #include 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); }