Revision: 8583 https://osdn.net/projects/ttssh2/scm/svn/commits/8583 Author: zmatsuo Date: 2020-03-10 23:09:26 +0900 (Tue, 10 Mar 2020) Log Message: ----------- SSH認証ダイアログの SSH AUTH BANNER を多言語化 Modified Paths: -------------- trunk/ttssh2/ttxssh/auth.c -------------- next part -------------- Modified: trunk/ttssh2/ttxssh/auth.c =================================================================== --- trunk/ttssh2/ttxssh/auth.c 2020-03-10 14:09:15 UTC (rev 8582) +++ trunk/ttssh2/ttxssh/auth.c 2020-03-10 14:09:26 UTC (rev 8583) @@ -1,6 +1,6 @@ /* * Copyright (c) 1998-2001, Robert O'Callahan - * (c) 2004-2029 TeraTerm Project + * (c) 2004-2020 TeraTerm Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -51,6 +51,8 @@ #include "tipwin.h" #include "auth.h" #include "helpid.h" +#include "codeconv.h" +#include "layer_for_unicode.h" #define AUTH_START_USER_AUTH_ON_ERROR_END 1 @@ -184,11 +186,14 @@ static void init_auth_machine_banner(PTInstVar pvar, HWND dlg) { - char buf[1024], buf2[1024]; + wchar_t buf[1024], buf2[1024]; + const char *host_name = SSH_get_host_name(pvar); + wchar_t *host_nameW = ToWcharA(host_name); - GetDlgItemText(dlg, IDC_SSHAUTHBANNER, buf2, sizeof(buf2)); - _snprintf_s(buf, sizeof(buf), _TRUNCATE, buf2, SSH_get_host_name(pvar)); - SetDlgItemText(dlg, IDC_SSHAUTHBANNER, buf); + _GetDlgItemTextW(dlg, IDC_SSHAUTHBANNER, buf2, _countof(buf2)); + _snwprintf_s(buf, _countof(buf), _TRUNCATE, buf2, host_nameW); + _SetDlgItemTextW(dlg, IDC_SSHAUTHBANNER, buf); + free(host_nameW); } static void update_server_supported_types(PTInstVar pvar, HWND dlg)