1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

fix scm_from_stringn empty string case

* libguile/strings.c (scm_from_stringn): Fix empty string case
  (oops...).
This commit is contained in:
Andy Wingo 2011-01-07 22:16:10 -08:00
parent 2dd7d8ce7a
commit a574564c24

View file

@ -1438,12 +1438,12 @@ scm_from_stringn (const char *str, size_t len, const char *encoding,
SCM res;
/* The order of these checks is important. */
if (len == 0)
return scm_nullstr;
if (!str)
if (!str && len != 0)
scm_misc_error ("scm_from_stringn", "NULL string pointer", SCM_EOL);
if (len == (size_t) -1)
len = strlen (str);
if (len == 0)
return scm_nullstr;
if (encoding == NULL)
{