From a56fe59ac345e61c04632dc20785e52aefd1c2e9 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Tue, 14 Jan 2014 14:56:30 +0000 Subject: -Converted Ping to Unicode -Fixed minor bugs (fixes #526) git-svn-id: http://svn.miranda-ng.org/main/trunk@7644 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Ping/src/pinggraph.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'plugins/Ping/src/pinggraph.cpp') diff --git a/plugins/Ping/src/pinggraph.cpp b/plugins/Ping/src/pinggraph.cpp index 453303fb5a..cc2252a521 100644 --- a/plugins/Ping/src/pinggraph.cpp +++ b/plugins/Ping/src/pinggraph.cpp @@ -187,23 +187,23 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar SetBkMode(hdc, TRANSPARENT); SetTextColor(hdc, GetSysColor(COLOR_3DDKSHADOW)); - char buff[64]; + TCHAR buff[64]; if(wd->show_grid) { - mir_snprintf(buff, SIZEOF(buff), Translate("%d ms"), MARK_TIME); - TextOut(hdc, r.right - 100, r.bottom - (int)(unit_height * MARK_TIME + 0.5f), buff, (int)strlen(buff)); + mir_sntprintf(buff, SIZEOF(buff), TranslateT("%d ms"), MARK_TIME); + TextOut(hdc, r.right - 100, r.bottom - (int)(unit_height * MARK_TIME + 0.5f), buff, (int)_tcslen(buff)); } if (wd->show_stat) { SetTextColor(hdc, RGB(255, 0, 0)); - mir_snprintf(buff, SIZEOF(buff), Translate("AVG %.1lf ms"), avg); - TextOut(hdc, r.left + 10, r.bottom - (int)(avg * unit_height + 0.5f), buff, (int)strlen(buff)); + mir_sntprintf(buff, SIZEOF(buff), TranslateT("AVG %.1lf ms"), avg); + TextOut(hdc, r.left + 10, r.bottom - (int)(avg * unit_height + 0.5f), buff, (int)_tcslen(buff)); if (max_value != avg) { - mir_snprintf(buff, SIZEOF(buff), Translate("MAX %hd ms"), max_value); - TextOut(hdc, r.left + 10, r.bottom - (int)(max_value * unit_height + 0.5f), buff, (int)strlen(buff)); - mir_snprintf(buff, SIZEOF(buff), Translate("MIN %hd ms"), min_value); - TextOut(hdc, r.left + 10, r.bottom - (int)(min_value * unit_height + 0.5f), buff, (int)strlen(buff)); + mir_sntprintf(buff, SIZEOF(buff), TranslateT("MAX %hd ms"), max_value); + TextOut(hdc, r.left + 10, r.bottom - (int)(max_value * unit_height + 0.5f), buff, (int)_tcslen(buff)); + mir_sntprintf(buff, SIZEOF(buff), TranslateT("MIN %hd ms"), min_value); + TextOut(hdc, r.left + 10, r.bottom - (int)(min_value * unit_height + 0.5f), buff, (int)_tcslen(buff)); } } @@ -275,11 +275,11 @@ INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) { wndclass.lpszClassName = _T(PLUG) _T("GraphWindow"); RegisterClass(&wndclass); - char title[256]; - strcpy(title, "Ping Graph"); + TCHAR title[256]; + _tcsncpy(title, TranslateT("Ping Graph"), SIZEOF(title)); if(lParam) { - strcat(title, " - "); - strncat(title, (char *)lParam, 256 - 13); + _tcsncat(title, _T(" - "), SIZEOF(title)); + _tcsncat(title, (TCHAR *)lParam, SIZEOF(title)); } HWND parent = 0; -- cgit v1.2.3