diff --git a/src/intl/charsets.c b/src/intl/charsets.c index d08c575d..6df8e8ad 100644 --- a/src/intl/charsets.c +++ b/src/intl/charsets.c @@ -813,8 +813,9 @@ free_utf_table(void) { int i; + /* Cast away const. */ for (i = 128; i < 256; i++) - mem_free(utf_table[i].u.str); + mem_free((unsigned char *) utf_table[i].u.str); } static struct conv_table * @@ -1191,7 +1192,7 @@ convert_string(struct conv_table *convert_table, /* Iterate ;-) */ while (charspos < charslen) { - unsigned char *translit; + const unsigned char *translit; #define PUTC do { \ buffer[bufferpos++] = chars[charspos++]; \ diff --git a/src/intl/charsets.h b/src/intl/charsets.h index 43259de0..edae15f6 100644 --- a/src/intl/charsets.h +++ b/src/intl/charsets.h @@ -44,7 +44,7 @@ struct conv_table { * However, if the translation table is to UTF-8, * then the strings in elements 0x80 to 0xFF are * allocated with mem_alloc. */ - unsigned char *str; + const unsigned char *str; /* If @t==1: a pointer to a nested conversion table * (with 256 elements) that describes how to convert * each possible subsequent byte. The conversion