From 4c814798c7bc7f6a0f92c21b027b26290622aa2f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 19 Jun 2015 19:35:42 +0000 Subject: SIZEOF replaced with more secure analog - _countof git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Ping/src/utils.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'plugins/Ping/src/utils.cpp') diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index aca8eab105..16adad8964 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -38,8 +38,8 @@ void __stdcall ShowPopup(TCHAR *line1, TCHAR *line2, int flags) ppd->lchContact = NULL; ppd->lchIcon = (flags ? hIconResponding : hIconNotResponding); - mir_tstrncpy(ppd->lptzContactName, line1, SIZEOF(ppd->lptzContactName)); - mir_tstrncpy(ppd->lptzText, line2, SIZEOF(ppd->lptzText)); + mir_tstrncpy(ppd->lptzContactName, line1, _countof(ppd->lptzContactName)); + mir_tstrncpy(ppd->lptzText, line2, _countof(ppd->lptzText)); ppd->colorBack = GetSysColor(COLOR_BTNFACE); ppd->colorText = GetSysColor(COLOR_WINDOWTEXT); @@ -221,26 +221,26 @@ void import_ping_address(int index, PINGADDRESS &pa) { char buf[256]; mir_snprintf(buf, "Address%d", index); if (!db_get_ts(0, "PingPlug", buf, &dbv)) { - mir_tstrncpy(pa.pszName, dbv.ptszVal, SIZEOF(pa.pszName)); + mir_tstrncpy(pa.pszName, dbv.ptszVal, _countof(pa.pszName)); db_free(&dbv); } else - mir_tstrncpy(pa.pszName, TranslateT("Unknown Address"), SIZEOF(pa.pszName)); + mir_tstrncpy(pa.pszName, TranslateT("Unknown Address"), _countof(pa.pszName)); mir_snprintf(buf, "Label%d", index); if (!db_get_ts(0, "PingPlug", buf, &dbv)) { - mir_tstrncpy(pa.pszLabel, dbv.ptszVal, SIZEOF(pa.pszLabel)); + mir_tstrncpy(pa.pszLabel, dbv.ptszVal, _countof(pa.pszLabel)); db_free(&dbv); } else - mir_tstrncpy(pa.pszLabel, TranslateT("Unknown"), SIZEOF(pa.pszLabel)); + mir_tstrncpy(pa.pszLabel, TranslateT("Unknown"), _countof(pa.pszLabel)); mir_snprintf(buf, "Port%d", index); pa.port = (int)db_get_dw(0, "PingPlug", buf, -1); mir_snprintf(buf, "Proto%d", index); if (!db_get_s(0, "PingPlug", buf, &dbv)) { - mir_strncpy(pa.pszProto, dbv.pszVal, SIZEOF(pa.pszProto)); + mir_strncpy(pa.pszProto, dbv.pszVal, _countof(pa.pszProto)); db_free(&dbv); mir_snprintf(buf, "Status%d", index); pa.set_status = db_get_w(0, "PingPlug", buf, ID_STATUS_ONLINE); -- cgit v1.2.3