summaryrefslogtreecommitdiff
path: root/display.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2011-09-03 14:05:21 +0200
committerAxel Beckert <abe@deuxchevaux.org>2011-09-03 14:05:21 +0200
commit14a4b00c9ef680b78469333291270e4c276f100d (patch)
tree6479193bac66d70af7f7b8133498b4d61a0fd29b /display.c
parent0636e9ecb5a32db4d4520f50a20652faa825feaf (diff)
downloadscreen-14a4b00c9ef680b78469333291270e4c276f100d.tar.gz
Imported Upstream version 3.7.4upstream/3.7.4
Diffstat (limited to 'display.c')
-rw-r--r--display.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/display.c b/display.c
index e4cdb1c..3a47928 100644
--- a/display.c
+++ b/display.c
@@ -269,9 +269,10 @@ struct mode *Mode;
D_dospeed = (short) D_OldMode.m_ttyb.sg_ospeed;
#endif /* POSIX || TERMIO */
debug1("New displays ospeed = %d\n", D_dospeed);
- strcpy(D_usertty, utty);
- strcpy(D_termname, term);
-
+ strncpy(D_usertty, utty, sizeof(D_usertty) - 1);
+ D_usertty[sizeof(D_usertty) - 1] = 0;
+ strncpy(D_termname, term, sizeof(D_termname) - 1);
+ D_termname[sizeof(D_termname) - 1] = 0;
D_user = *u;
D_lay = &BlankLayer;
D_layfn = BlankLayer.l_layfn;
@@ -477,7 +478,7 @@ int c;
else if (D_kanji == SJIS)
{
t += (c & 1) ? ((t <= 0x5f) ? 0x1f : 0x20) : 0x7e;
- c = (c - 0x21) / 2 + ((c < 0x5e) ? 0x81 : 0xc1);
+ c = (c - 0x21) / 2 + ((c < 0x5f) ? 0x81 : 0xc1);
}
D_mbcs = t;
}
@@ -1887,7 +1888,12 @@ NukePending()
PutStr(D_EI);
D_insert = 0;
/* Check for toggle */
-#ifndef MAPKEYS
+#ifdef MAPKEYS
+ if (D_KS && strcmp(D_KS, D_KE))
+ PutStr(D_KS);
+ if (D_CCS && strcmp(D_CCS, D_CCE))
+ PutStr(D_CCS);
+#else
if (D_KS && strcmp(D_KS, D_KE))
PutStr(D_KE);
D_keypad = 0;