Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/ttssh2/ttxssh/hosts.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 8542 by zmatsuo, Sun Feb 16 14:55:30 2020 UTC revision 8593 by zmatsuo, Thu Mar 12 13:52:38 2020 UTC
# Line 56  See LICENSE.TXT for the license. Line 56  See LICENSE.TXT for the license.
56    
57  #include "codeconv.h"  #include "codeconv.h"
58  #include "layer_for_unicode.h"  #include "layer_for_unicode.h"
59    #include "asprintf.h"
60    
61  #undef DialogBoxParam  #undef DialogBoxParam
62  #define DialogBoxParam(p1,p2,p3,p4,p5) \  #define DialogBoxParam(p1,p2,p3,p4,p5) \
# Line 989  static void hosts_dlg_set_fingerprint(PT Line 990  static void hosts_dlg_set_fingerprint(PT
990  static void init_hosts_dlg(PTInstVar pvar, HWND dlg)  static void init_hosts_dlg(PTInstVar pvar, HWND dlg)
991  {  {
992          wchar_t buf[MAX_UIMSG];          wchar_t buf[MAX_UIMSG];
993          wchar_t buf2[2048];          wchar_t *buf2;
         size_t i, j;  
         wchar_t ch;  
994          wchar_t *hostW;          wchar_t *hostW;
995    
996          // static textの # 部分をホスト名に置換する          // ホスト名に置換する
997          _GetDlgItemTextW(dlg, IDC_HOSTWARNING, buf, sizeof(buf));          _GetDlgItemTextW(dlg, IDC_HOSTWARNING, buf, _countof(buf));
         for (i = 0; (ch = buf[i]) != 0 && ch != L'#'; i++) {  
                 buf2[i] = ch;  
         }  
998          hostW = ToWcharA(pvar->hosts_state.prefetched_hostname);          hostW = ToWcharA(pvar->hosts_state.prefetched_hostname);
999          wcsncpy_s(buf2 + i, _countof(buf2) - i, hostW, _TRUNCATE);          aswprintf(&buf2, buf, hostW);
1000          free(hostW);          free(hostW);
         j = i + wcslen(buf2 + i);  
         for (; buf[i] == L'#'; i++) {  
         }  
         wcsncpy_s(buf2 + j, _countof(buf2) - j, buf + i, _TRUNCATE);  
   
1001          _SetDlgItemTextW(dlg, IDC_HOSTWARNING, buf2);          _SetDlgItemTextW(dlg, IDC_HOSTWARNING, buf2);
1002            free(buf2);
1003    
1004          pvar->hFontFixed = UTIL_get_lang_fixedfont(dlg, pvar->ts->UILanguageFile);          pvar->hFontFixed = UTIL_get_lang_fixedfont(dlg, pvar->ts->UILanguageFile);
1005          if (pvar->hFontFixed != NULL) {          if (pvar->hFontFixed != NULL) {

Legend:
Removed from v.8542  
changed lines
  Added in v.8593

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26