[Ttssh2-commit] [8673] タイトルが wchar_t に変換できないときクラッシュしないようにした

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2020年 4月 4日 (土) 00:32:42 JST


Revision: 8673
          https://osdn.net/projects/ttssh2/scm/svn/commits/8673
Author:   zmatsuo
Date:     2020-04-04 00:32:42 +0900 (Sat, 04 Apr 2020)
Log Message:
-----------
タイトルが wchar_t に変換できないときクラッシュしないようにした

Modified Paths:
--------------
    trunk/teraterm/teraterm/ttwinman.c

-------------- next part --------------
Modified: trunk/teraterm/teraterm/ttwinman.c
===================================================================
--- trunk/teraterm/teraterm/ttwinman.c	2020-04-03 15:32:32 UTC (rev 8672)
+++ trunk/teraterm/teraterm/ttwinman.c	2020-04-03 15:32:42 UTC (rev 8673)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2005-2019 TeraTerm Project
+ * (C) 2005-2020 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -94,6 +94,10 @@
 	{
 		wchar_t *title = ToWcharA(ts.Title);
 		wchar_t *title_remote = ToWcharA(cv.TitleRemote);
+		if (title_remote == NULL) {
+			// TODO cv.TitleRemote \x82\xAA strncpy_s() \x82ŕs\x90\xB3\x82ȕ\xB6\x8E\x9A\x82\xAA\x8A܂܂ꂽ\x82Ƃ\xAB NULL \x82\xAA\x95Ԃ\xE9
+			title_remote = _wcsdup(L"-");
+		}
 		if (Connecting || !cv.Ready || wcslen(title_remote) == 0) {
 			wcsncpy_s(TempTitleWithRemote, _countof(TempTitleWithRemote), title, _TRUNCATE);
 			wcsncpy_s(TempTitle, _countof(TempTitle), title, _TRUNCATE);


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