• R/O
  • SSH
  • HTTPS

ttssh2: 提交


Commit MetaInfo

修訂8673 (tree)
時間2020-04-04 00:32:42
作者zmatsuo

Log Message

タイトルが wchar_t に変換できないときクラッシュしないようにした

Change Summary

差異

--- trunk/teraterm/teraterm/ttwinman.c (revision 8672)
+++ trunk/teraterm/teraterm/ttwinman.c (revision 8673)
@@ -1,6 +1,6 @@
11 /*
22 * Copyright (C) 1994-1998 T. Teranishi
3- * (C) 2005-2019 TeraTerm Project
3+ * (C) 2005-2020 TeraTerm Project
44 * All rights reserved.
55 *
66 * Redistribution and use in source and binary forms, with or without
@@ -94,6 +94,10 @@
9494 {
9595 wchar_t *title = ToWcharA(ts.Title);
9696 wchar_t *title_remote = ToWcharA(cv.TitleRemote);
97+ if (title_remote == NULL) {
98+ // TODO cv.TitleRemote が strncpy_s() で不正な文字が含まれたとき NULL が返る
99+ title_remote = _wcsdup(L"-");
100+ }
97101 if (Connecting || !cv.Ready || wcslen(title_remote) == 0) {
98102 wcsncpy_s(TempTitleWithRemote, _countof(TempTitleWithRemote), title, _TRUNCATE);
99103 wcsncpy_s(TempTitle, _countof(TempTitle), title, _TRUNCATE);
Show on old repository browser