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

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
This commit is contained in:
Michael Gran 2009-12-27 18:44:29 -08:00
parent 3323ec063c
commit b349875146

View file

@ -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;
}