[ttssh2-commit] [10468] コンパイラ警告対応

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2023年 1月 10日 (火) 22:17:53 JST


Revision: 10468
          https://osdn.net/projects/ttssh2/scm/svn/commits/10468
Author:   zmatsuo
Date:     2023-01-10 22:17:53 +0900 (Tue, 10 Jan 2023)
Log Message:
-----------
コンパイラ警告対応

- 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup.
- 'wcsdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _wcsdup.

Modified Paths:
--------------
    trunk/teraterm/teraterm/filesys_log.cpp
    trunk/ttssh2/ttxssh/ssh.c

-------------- next part --------------
Modified: trunk/teraterm/teraterm/filesys_log.cpp
===================================================================
--- trunk/teraterm/teraterm/filesys_log.cpp	2023-01-10 13:17:43 UTC (rev 10467)
+++ trunk/teraterm/teraterm/filesys_log.cpp	2023-01-10 13:17:53 UTC (rev 10468)
@@ -214,7 +214,7 @@
 				wchar_t user[256 + 1];	// 256=UNLEN
 				DWORD l = _countof(user);
 				if (GetUserNameW(user, &l) != 0) {
-					add_text = wcsdup(user);
+					add_text = _wcsdup(user);
 				}
 				break;
 			}
@@ -1388,10 +1388,10 @@
 	const wchar_t *last_path_sep = wcsrchr(filename, L'\\');
 	wchar_t *format;
 	if (last_path_sep == NULL) {
-		format = wcsdup(filename);
+		format = _wcsdup(filename);
 	}
 	else {
-		format = wcsdup(last_path_sep + 1);
+		format = _wcsdup(last_path_sep + 1);
 	}
 
 	// strftime \x82Ɏg\x97p\x82ł\xAB\x82Ȃ\xA2\x95\xB6\x8E\x9A\x82\xF0\x8D폜
@@ -1400,7 +1400,7 @@
 	// \x95\xB6\x8E\x9A\x97񒷂\xAA0\x82ɂȂ\xC1\x82\xBD?
 	if (format[0] == 0) {
 		free(format);
-		return wcsdup(L"");
+		return _wcsdup(L"");
 	}
 
 	// \x8C\xBB\x8Dݎ\x9E\x8D\x8F\x82\xF0\x8E擾
@@ -1418,7 +1418,7 @@
 		if (formated_realloc == NULL) {
 			free(format);
 			free(formated);
-			return wcsdup(L"");
+			return _wcsdup(L"");
 		}
 		formated = formated_realloc;
 		size_t r = wcsftime(formated, len, format, &tm_local);
@@ -1460,8 +1460,8 @@
 	wchar_t *dir;
 	wchar_t *fname;
 	if (log_filename == NULL) {
-		dir = wcsdup(ts.LogDefaultPathW);
-		fname = wcsdup(ts.LogDefaultNameW);
+		dir = _wcsdup(ts.LogDefaultPathW);
+		fname = _wcsdup(ts.LogDefaultNameW);
 	} else if (!IsRelativePathW(log_filename)) {
 		// \x90\xE2\x91΃p\x83X\x82\xAA\x93\xFC\x97͂\xB3\x82ꂽ
 		dir = ExtractDirNameW(log_filename);
@@ -1468,8 +1468,8 @@
 		fname = ExtractFileNameW(log_filename);
 	}
 	else {
-		dir = wcsdup(ts.LogDefaultPathW);
-		fname = wcsdup(log_filename);
+		dir = _wcsdup(ts.LogDefaultPathW);
+		fname = _wcsdup(log_filename);
 	}
 
 	wchar_t *formated = FLogGetLogFilenameBase(fname);

Modified: trunk/ttssh2/ttxssh/ssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ssh.c	2023-01-10 13:17:43 UTC (rev 10467)
+++ trunk/ttssh2/ttxssh/ssh.c	2023-01-10 13:17:53 UTC (rev 10468)
@@ -6316,7 +6316,7 @@
 				          __FUNCTION__, pvar->server_sig_algs, ext_val);
 				free(pvar->server_sig_algs);
 			}
-			pvar->server_sig_algs = strdup(ext_val);
+			pvar->server_sig_algs = _strdup(ext_val);
 			logprintf(LOG_LEVEL_VERBOSE, "%s: extension: server-sig-algs, value: %s", __FUNCTION__, ext_val);
 		}
 		else {


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