]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/alloc_str.c
Merge branch 'master' into dev-sizet
[libucw.git] / ucw / alloc_str.c
index 5b3d839253b1e5b7c0f25a3adb6d5ea395eb4332..90bc747036e1d6dd384a441b6c6c6b600e0fb28e 100644 (file)
@@ -7,13 +7,15 @@
  *     of the GNU Lesser General Public License.
  */
 
-#include "ucw/lib.h"
+#include <ucw/lib.h>
 
 #include <string.h>
 
 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);
 }