X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwinucs.c;h=c1888f9eda93ba6663b6368ef9a36d348f8f62e7;hb=9f9d72ec58642e91b4f93ee4405a8086ee2fb2f0;hp=857ffb1b83ecca5d333689a80d211ebe1896e2e8;hpb=61e555ec797b60041a39d3ce28a68ac1975252ef;p=PuTTY.git diff --git a/windows/winucs.c b/windows/winucs.c index 857ffb1b..c1888f9e 100644 --- a/windows/winucs.c +++ b/windows/winucs.c @@ -441,12 +441,8 @@ void init_ucs(Conf *conf, struct unicode_data *ucsdata) { int i, j; int used_dtf = 0; - char tbuf[256]; int vtmode; - for (i = 0; i < 256; i++) - tbuf[i] = i; - /* Decide on the Line and Font codepages */ ucsdata->line_codepage = decode_codepage(conf_get_str(conf, CONF_line_codepage)); @@ -1041,16 +1037,18 @@ int decode_codepage(char *cp_name) if (GetCPInfo(codepage, &cpinfo) != 0) goto break_break; } - if (tolower(*s++) != tolower(*d++)) + if (tolower((unsigned char)*s++) != tolower((unsigned char)*d++)) break; } } d = cp_name; - if (tolower(d[0]) == 'c' && tolower(d[1]) == 'p') + if (tolower((unsigned char)d[0]) == 'c' && + tolower((unsigned char)d[1]) == 'p') d += 2; - if (tolower(d[0]) == 'i' && tolower(d[1]) == 'b' - && tolower(d[2]) == 'm') + if (tolower((unsigned char)d[0]) == 'i' && + tolower((unsigned char)d[1]) == 'b' && + tolower((unsigned char)d[2]) == 'm') d += 3; for (s = d; *s >= '0' && *s <= '9'; s++); if (*s == 0 && s != d) @@ -1163,7 +1161,7 @@ void get_unitab(int codepage, wchar_t * unitab, int ftype) } int wc_to_mb(int codepage, int flags, const wchar_t *wcstr, int wclen, - char *mbstr, int mblen, char *defchr, int *defused, + char *mbstr, int mblen, const char *defchr, int *defused, struct unicode_data *ucsdata) { char *p;