diff options
author | Michael Gran <spk121@yahoo.com> | 2009-12-27 18:44:29 -0800 |
---|---|---|
committer | Michael Gran <spk121@yahoo.com> | 2009-12-27 18:44:29 -0800 |
commit | b349875146af814dbeac07e96b043a3a3996b7cd (patch) | |
tree | 4f2a8ff463cdf6febead9d00ac62a11d7235f9be /libguile/chars.c | |
parent | 3323ec063ccc87b210e6da04c57c625af270b230 (diff) | |
download | guile-b349875146af814dbeac07e96b043a3a3996b7cd.tar.gz |
Incorrect indexing into character name list
When converting a character into a character name, an incorrect
character name could theoretically have been returned.
* libguile/chars.c (scm_i_charname): used wrong index into
scm_alt_charnames
Diffstat (limited to 'libguile/chars.c')
-rw-r--r-- | libguile/chars.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libguile/chars.c b/libguile/chars.c index 16a2b90d6..49c1ea3f7 100644 --- a/libguile/chars.c +++ b/libguile/chars.c @@ -577,9 +577,11 @@ scm_i_charname (SCM chr) if (scm_C0_control_charnums[c] == i) return scm_C0_control_charnames[c]; + /* Since the characters in scm_alt_charnums is a subset of + scm_C0_control_charnums, this code is never reached. */ for (c = 0; c < SCM_N_ALT_CHARNAMES; c++) if (scm_alt_charnums[c] == i) - return scm_alt_charnames[i]; + return scm_alt_charnames[c]; return NULL; } |