From 13eb83bea655c3302c74a82d826d75bceb9232a2 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Mon, 8 Dec 2014 22:13:57 +0000 Subject: code cleanup around mir_snprintf git-svn-id: http://svn.miranda-ng.org/main/trunk@11285 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Ping/src/icmp.cpp | 2 +- plugins/Ping/src/utils.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'plugins/Ping') diff --git a/plugins/Ping/src/icmp.cpp b/plugins/Ping/src/icmp.cpp index 3cd34384bc..dfa0c86578 100644 --- a/plugins/Ping/src/icmp.cpp +++ b/plugins/Ping/src/icmp.cpp @@ -68,7 +68,7 @@ bool ICMP::ping(char *host, ICMP_ECHO_REPLY &reply) { char winmsg[512], msg[1024]; FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, 0, code, 0, winmsg, 512, 0); - mir_snprintf(msg, 1024, "Ping error (%d): %s", code, winmsg); + mir_snprintf(msg, SIZEOF(msg), "Ping error (%d): %s", code, winmsg); PUShowMessage(msg, SM_NOTIFY); return false; } diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index 814e4d6f81..8aaf1d21b6 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -237,30 +237,30 @@ INT_PTR DblClick(WPARAM wParam, LPARAM lParam) { void import_ping_address(int index, PINGADDRESS &pa) { DBVARIANT dbv; char buf[256]; - mir_snprintf(buf, 256, "Address%d", index); + mir_snprintf(buf, SIZEOF(buf), "Address%d", index); if(!db_get_ts(0, "PingPlug", buf, &dbv)) { _tcsncpy(pa.pszName, dbv.ptszVal, MAX_PINGADDRESS_STRING_LENGTH); db_free(&dbv); } else _tcsncpy(pa.pszName, TranslateT("Unknown Address"), MAX_PINGADDRESS_STRING_LENGTH); - mir_snprintf(buf, 256, "Label%d", index); + mir_snprintf(buf, SIZEOF(buf), "Label%d", index); if(!db_get_ts(0, "PingPlug", buf, &dbv)) { _tcsncpy(pa.pszLabel, dbv.ptszVal, MAX_PINGADDRESS_STRING_LENGTH); db_free(&dbv); } else _tcsncpy(pa.pszLabel, TranslateT("Unknown"), MAX_PINGADDRESS_STRING_LENGTH); - mir_snprintf(buf, 256, "Port%d", index); + mir_snprintf(buf, SIZEOF(buf), "Port%d", index); pa.port = (int)db_get_dw(0, "PingPlug", buf, -1); - mir_snprintf(buf, 256, "Proto%d", index); + mir_snprintf(buf, SIZEOF(buf), "Proto%d", index); if(!db_get_s(0, "PingPlug", buf, &dbv)) { strncpy(pa.pszProto, dbv.pszVal, MAX_PINGADDRESS_STRING_LENGTH); db_free(&dbv); - mir_snprintf(buf, 256, "Status%d", index); + mir_snprintf(buf, SIZEOF(buf), "Status%d", index); pa.set_status = db_get_w(0, "PingPlug", buf, ID_STATUS_ONLINE); - mir_snprintf(buf, 256, "Status2%d", index); + mir_snprintf(buf, SIZEOF(buf), "Status2%d", index); pa.get_status = db_get_w(0, "PingPlug", buf, ID_STATUS_OFFLINE); } else pa.pszProto[0] = '\0'; @@ -274,7 +274,7 @@ void import_ping_address(int index, PINGADDRESS &pa) { pa.pszParams[0] = '\0'; pa.item_id = 0; - mir_snprintf(buf, 256, "Enabled%d", index); + mir_snprintf(buf, SIZEOF(buf), "Enabled%d", index); if(db_get_b(0, "PingPlug", buf, 1) == 1) pa.status = PS_NOTRESPONDING; else -- cgit v1.2.3