summaryrefslogtreecommitdiff
path: root/libguile/strings.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2013-01-15 15:06:37 +0100
committerAndy Wingo <wingo@pobox.com>2013-01-15 16:32:52 +0100
commitb39685c6da974d5edc5629495c559ab8e1137103 (patch)
tree783b78cda439e97e10879055ce5db8b765bb381c /libguile/strings.c
parentd1b9f8ace937085e084e0d9afbbc5e2944141413 (diff)
downloadguile-b39685c6da974d5edc5629495c559ab8e1137103.tar.gz
scm_from_stringn and scm_to_stringn encoding args are never NULL
* libguile/strings.c (scm_from_stringn, scm_to_stringn): Encoding argument cannot be NULL. Instead check that the encoding was ISO-8859-1.
Diffstat (limited to 'libguile/strings.c')
-rw-r--r--libguile/strings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/strings.c b/libguile/strings.c
index 3db526e92..85a6c4839 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -1524,7 +1524,7 @@ scm_from_stringn (const char *str, size_t len, const char *encoding,
if (len == (size_t) -1)
len = strlen (str);
- if (encoding == NULL || len == 0)
+ if (strcmp (encoding, "ISO-8859-1") == 0 || len == 0)
return scm_from_latin1_stringn (str, len);
else if (strcmp (encoding, "UTF-8") == 0
&& handler == SCM_FAILED_CONVERSION_ERROR)
@@ -2170,7 +2170,7 @@ scm_to_stringn (SCM str, size_t *lenp, const char *encoding,
"string contains #\\nul character: ~S",
scm_list_1 (str));
- if (scm_i_is_narrow_string (str) && (encoding == NULL))
+ if (scm_i_is_narrow_string (str) && strcmp (encoding, "ISO-8859-1") == 0)
{
/* If using native Latin-1 encoding, just copy the string
contents. */