mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-13 12:40:24 +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:
parent
2dd7d8ce7a
commit
a574564c24
1 changed files with 3 additions and 3 deletions
|
@ -1438,12 +1438,12 @@ scm_from_stringn (const char *str, size_t len, const char *encoding,
|
||||||
SCM res;
|
SCM res;
|
||||||
|
|
||||||
/* The order of these checks is important. */
|
/* The order of these checks is important. */
|
||||||
if (len == 0)
|
if (!str && len != 0)
|
||||||
return scm_nullstr;
|
|
||||||
if (!str)
|
|
||||||
scm_misc_error ("scm_from_stringn", "NULL string pointer", SCM_EOL);
|
scm_misc_error ("scm_from_stringn", "NULL string pointer", SCM_EOL);
|
||||||
if (len == (size_t) -1)
|
if (len == (size_t) -1)
|
||||||
len = strlen (str);
|
len = strlen (str);
|
||||||
|
if (len == 0)
|
||||||
|
return scm_nullstr;
|
||||||
|
|
||||||
if (encoding == NULL)
|
if (encoding == NULL)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue