Make implementation comment about issues with strlen of
authorNelson Ferreira <nelson.ferreira@ieee.org>
Fri, 16 Sep 2011 03:17:23 +0000 (23:17 -0400)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Fri, 16 Sep 2011 03:17:23 +0000 (23:17 -0400)
NULL pointers match the implementation
Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
src/alloc.c

index 56257c1..3e8206a 100644 (file)
@@ -3258,7 +3258,7 @@ Lisp_Object build_string(const char *str)
 Lisp_Object build_ext_string(const char *str, Lisp_Object coding_system)
 {
        /* Some strlen's crash and burn if passed null. */
-       return make_ext_string((const Extbyte*)str, strlen(str), coding_system);
+       return make_ext_string((const Extbyte*)str, (str ? strlen(str) : 0), coding_system);
 }
 
 Lisp_Object build_translated_string(const char *str)