| 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) \ |
| 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) { |