[Ttssh2-commit] [6786] 端末設定ダイアログで、端末サイズが 0 だった場合は変更しないようにした。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2017年 6月 9日 (金) 19:04:36 JST


Revision: 6786
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6786
Author:   doda
Date:     2017-06-09 19:04:36 +0900 (Fri, 09 Jun 2017)
Log Message:
-----------
端末設定ダイアログで、端末サイズが 0 だった場合は変更しないようにした。

0 を入力したか、BS 等で値を削除した時が該当。
おそらく入力ミスだと考えられるので、1 にするよりは妥当だと思う。

Modified Paths:
--------------
    trunk/teraterm/ttpdlg/ttdlg.c

-------------- next part --------------
Modified: trunk/teraterm/ttpdlg/ttdlg.c
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.c	2017-06-09 10:04:32 UTC (rev 6785)
+++ trunk/teraterm/ttpdlg/ttdlg.c	2017-06-09 10:04:36 UTC (rev 6786)
@@ -355,21 +355,29 @@
 					ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
 
 					if ( ts!=NULL ) {
-						ts->TerminalWidth = GetDlgItemInt(Dialog,IDC_TERMWIDTH,NULL,FALSE);
-						if ( ts->TerminalWidth<1 ) {
-							ts->TerminalWidth = 1;
-						}
-						else if ( ts->TerminalWidth>TermWidthMax ) {
+						int width, height;
+
+						width = GetDlgItemInt(Dialog, IDC_TERMWIDTH, NULL, FALSE);
+						if (width > TermWidthMax) {
 							ts->TerminalWidth = TermWidthMax;
 						}
+						else if (width > 0) {
+							ts->TerminalWidth = width;
+						}
+						else { // 0 \x88ȉ\xBA\x82̏ꍇ\x82͕ύX\x82\xB5\x82Ȃ\xA2
+							;
+						}
 
-						ts->TerminalHeight = GetDlgItemInt(Dialog,IDC_TERMHEIGHT,NULL,FALSE);
-						if ( ts->TerminalHeight<1 ) {
-							ts->TerminalHeight = 1;
-						}
-						else if ( ts->TerminalHeight>TermHeightMax ) {
+						height = GetDlgItemInt(Dialog, IDC_TERMHEIGHT, NULL, FALSE);
+						if (height > TermHeightMax) {
 							ts->TerminalHeight = TermHeightMax;
 						}
+						else if (height > 0) {
+							ts->TerminalHeight = height;
+						}
+						else { // 0 \x88ȉ\xBA\x82̏ꍇ\x82͕ύX\x82\xB5\x82Ȃ\xA2
+							;
+						}
 
 						GetRB(Dialog,&ts->TermIsWin,IDC_TERMISWIN,IDC_TERMISWIN);
 						GetRB(Dialog,&ts->AutoWinResize,IDC_TERMRESIZE,IDC_TERMRESIZE);



Ttssh2-commit メーリングリストの案内
Back to archive index