Fix problem quitting terminal window while Change Settings active
[u/mdw/putty] / unicode.c
index 24dfd44..c68017a 100644 (file)
--- a/unicode.c
+++ b/unicode.c
@@ -516,12 +516,12 @@ void init_ucs(Config *cfg, struct unicode_data *ucsdata)
            if (DIRECT_FONT(ucsdata->unitab_line[i]))
                continue;
            if (!ucsdata->uni_tbl) {
-               ucsdata->uni_tbl = smalloc(256 * sizeof(char *));
+               ucsdata->uni_tbl = snewn(256, char *);
                memset(ucsdata->uni_tbl, 0, 256 * sizeof(char *));
            }
            j = ((ucsdata->unitab_line[i] >> 8) & 0xFF);
            if (!ucsdata->uni_tbl[j]) {
-               ucsdata->uni_tbl[j] = smalloc(256 * sizeof(char));
+               ucsdata->uni_tbl[j] = snewn(256, char);
                memset(ucsdata->uni_tbl[j], 0, 256 * sizeof(char));
            }
            ucsdata->uni_tbl[j][ucsdata->unitab_line[i] & 0xFF] = i;
@@ -971,9 +971,9 @@ int check_compose_internal(int first, int second, int recurse)
     if (recurse == 0) {
        nc = check_compose_internal(second, first, 1);
        if (nc == -1)
-           nc = check_compose(toupper(first), toupper(second), 1);
+           nc = check_compose_internal(toupper(first), toupper(second), 1);
        if (nc == -1)
-           nc = check_compose(toupper(second), toupper(first), 1);
+           nc = check_compose_internal(toupper(second), toupper(first), 1);
     }
     return nc;
 }
@@ -1094,7 +1094,7 @@ int decode_codepage(char *cp_name)
     return codepage;
 }
 
-char *cp_name(int codepage)
+const char *cp_name(int codepage)
 {
     const struct cp_list_item *cpi, *cpno;
     static char buf[32];
@@ -1134,7 +1134,7 @@ char *cp_name(int codepage)
  * Return the nth code page in the list, for use in the GUI
  * configurer.
  */
-char *cp_enumerate(int index)
+const char *cp_enumerate(int index)
 {
     if (index < 0 || index >= lenof(cp_list))
        return NULL;