X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Falloc_str.c;h=90bc747036e1d6dd384a441b6c6c6b600e0fb28e;hb=0eb6d8317cdbdb28663ff779d31684b3c7a47274;hp=5b3d839253b1e5b7c0f25a3adb6d5ea395eb4332;hpb=1cf8ac51f5495ccd5187dc220ffc69e95d6e0cfc;p=libucw.git diff --git a/ucw/alloc_str.c b/ucw/alloc_str.c index 5b3d8392..90bc7470 100644 --- a/ucw/alloc_str.c +++ b/ucw/alloc_str.c @@ -7,13 +7,15 @@ * of the GNU Lesser General Public License. */ -#include "ucw/lib.h" +#include #include char * xstrdup(const char *s) { - uns l = strlen(s) + 1; + if (!s) + return NULL; + uint l = strlen(s) + 1; return memcpy(xmalloc(l), s, l); }