From 4f0e30cdf56fbafdf955bbe8b93930bab9e39bd0 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Sun, 30 Nov 2014 18:33:56 +0000 Subject: Fix buf size for Get/Set text, open/save file name SMS: SIZE_T -> size_t MRA: small code cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@11175 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Xfire/src/addgamedialog.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'protocols/Xfire/src/addgamedialog.cpp') diff --git a/protocols/Xfire/src/addgamedialog.cpp b/protocols/Xfire/src/addgamedialog.cpp index 26297e3bd6..8791aa76e3 100644 --- a/protocols/Xfire/src/addgamedialog.cpp +++ b/protocols/Xfire/src/addgamedialog.cpp @@ -275,7 +275,7 @@ BOOL OpenFileDialog(HWND hwndDlg, OPENFILENAMEA*ofn, char*exe) { ofn->lStructSize = sizeof(OPENFILENAMEA); ofn->hwndOwner = hwndDlg; ofn->lpstrFile = szFile; - ofn->nMaxFile = sizeof(szFile); + ofn->nMaxFile = SIZEOF(szFile); ofn->lpstrFilter = szFilter; ofn->nFilterIndex = 1; ofn->lpstrFileTitle = exe; @@ -308,7 +308,7 @@ INT_PTR CALLBACK DlgAddGameProc(HWND hwndDlg, { char temp[256]; //eingabe bei der suche auslesen - GetDlgItemTextA(hwndDlg, IDC_SEARCH, temp, 256); + GetDlgItemTextA(hwndDlg, IDC_SEARCH, temp, SIZEOF(temp)); //eingabe in der liste suchen int idx = SendDlgItemMessageA(hwndDlg, IDC_GAMELIST, LB_FINDSTRING, 0, (LPARAM)temp); //gefunden? @@ -628,7 +628,7 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM newgame = new Xfire_game(); //Spielname - GetDlgItemTextA(hwndDlg, IDC_ADD_NAME, temp, 256); + GetDlgItemTextA(hwndDlg, IDC_ADD_NAME, temp, SIZEOF(temp)); if (!strlen(temp)) { if (!editgame) delete newgame; @@ -643,7 +643,7 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM } //spielid nur setzen/prüfen, wenn kein editgame if (!editgame) { - GetDlgItemTextA(hwndDlg, IDC_ADD_ID, temp, 256); + GetDlgItemTextA(hwndDlg, IDC_ADD_ID, temp, SIZEOF(temp)); if (!strlen(temp)) { if (!editgame) delete newgame; @@ -671,7 +671,7 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM } } //zu sendene spielid - GetDlgItemTextA(hwndDlg, IDC_ADD_SENDID, temp, 256); + GetDlgItemTextA(hwndDlg, IDC_ADD_SENDID, temp, SIZEOF(temp)); if (strlen(temp)) { //standardmäßig wird bei einem customeintrag keine id versendet @@ -681,7 +681,7 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM } //launcher exe - GetDlgItemTextA(hwndDlg, IDC_ADD_LAUNCHEREXE, temp, 256); + GetDlgItemTextA(hwndDlg, IDC_ADD_LAUNCHEREXE, temp, SIZEOF(temp)); if (strlen(temp)) { //lowercase pfad @@ -690,7 +690,7 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM newgame->setString(temp, &newgame->launchparams); } //detectexe - GetDlgItemTextA(hwndDlg, IDC_ADD_DETECTEXE, temp, 256); + GetDlgItemTextA(hwndDlg, IDC_ADD_DETECTEXE, temp, SIZEOF(temp)); if (!strlen(temp)) { if (!editgame) delete newgame; @@ -708,13 +708,13 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM } //mustcontain parameter - GetDlgItemTextA(hwndDlg, IDC_ADD_CUSTOMPARAMS, temp, 256); + GetDlgItemTextA(hwndDlg, IDC_ADD_CUSTOMPARAMS, temp, SIZEOF(temp)); if (strlen(temp)) { newgame->setString(temp, &newgame->mustcontain); } //statusmsg speichern - GetDlgItemTextA(hwndDlg, IDC_ADD_STATUSMSG, temp, 256); + GetDlgItemTextA(hwndDlg, IDC_ADD_STATUSMSG, temp, SIZEOF(temp)); if (strlen(temp)) { newgame->setString(temp, &newgame->statusmsg); -- cgit v1.2.3