From 1db3c9000f555fb2e7fc6ea892054a943fbfa064 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Fri, 25 Mar 2005 20:54:09 +0000 Subject: [PATCH] Change from the head 2004-04-06 by Han-Wen Nienhuys: Fixes srfi-13 string-index segv on strings containing 8-bit characters, reported by Alexey Voinov. * chars.h (SCM_MAKE_CHAR): add (unsigned char) cast. This prevents havoc when hi-bit ASCII is subjected to SCM_MAKE_CHAR(). --- libguile/chars.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libguile/chars.h b/libguile/chars.h index 9d23eba8e..75cbe3e16 100644 --- a/libguile/chars.h +++ b/libguile/chars.h @@ -51,7 +51,7 @@ */ #define SCM_CHARP(x) (SCM_ITAG8(x) == scm_tc8_char) #define SCM_CHAR(x) ((unsigned int)SCM_ITAG8_DATA(x)) -#define SCM_MAKE_CHAR(x) SCM_MAKE_ITAG8((scm_t_bits) x, scm_tc8_char) +#define SCM_MAKE_CHAR(x) SCM_MAKE_ITAG8((scm_t_bits) (unsigned char) (x), scm_tc8_char)