diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
commit | 4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch) | |
tree | 9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /plugins/StatusPlugins/KeepStatus/keepstatus.cpp | |
parent | f0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (diff) |
SIZEOF replaced with more secure analog - _countof
git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/StatusPlugins/KeepStatus/keepstatus.cpp')
-rw-r--r-- | plugins/StatusPlugins/KeepStatus/keepstatus.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 2e1af36c2a..2be09d66f3 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -212,7 +212,7 @@ static int AssignStatus(TConnectionSettings* cs, int status, int lastStatus, TCH mir_cslock lck(GenStatusCS); char dbSetting[128]; - mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", cs->szName); + mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", cs->szName); cs->lastStatus = lastStatus == 0 ? cs->status : lastStatus; if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) cs->status = ID_STATUS_DISABLED; @@ -520,7 +520,7 @@ static int ProcessProtoAck(WPARAM, LPARAM lParam) return 0; char dbSetting[128]; - mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", ack->szModule); + mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", ack->szModule); if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) return 0; @@ -933,8 +933,8 @@ static int ProcessPopup(int reason, LPARAM lParam) for (int i = 0; i < connectionSettings.getCount(); i++) { if (mir_tstrlen(ps[i]->tszAccName) > 0 && mir_strlen(ps[i]->szName) > 0) { if (db_get_b(NULL, MODULENAME, SETTING_PUSHOWEXTRA, TRUE)) { - mir_sntprintf(protoInfoLine, SIZEOF(protoInfoLine), TranslateT("%s\t(will be set to %s)\r\n"), ps[i]->tszAccName, pcli->pfnGetStatusModeDescription(ps[i]->status, GSMDF_TCHAR)); - mir_tstrncat(protoInfo, protoInfoLine, SIZEOF(protoInfo) - mir_tstrlen(protoInfo) - 1); + mir_sntprintf(protoInfoLine, _countof(protoInfoLine), TranslateT("%s\t(will be set to %s)\r\n"), ps[i]->tszAccName, pcli->pfnGetStatusModeDescription(ps[i]->status, GSMDF_TCHAR)); + mir_tstrncat(protoInfo, protoInfoLine, _countof(protoInfo) - mir_tstrlen(protoInfo) - 1); } } } @@ -1051,7 +1051,7 @@ INT_PTR EnableProtocolService(WPARAM wParam, LPARAM lParam) return -1; char dbSetting[128]; - mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", szProto); + mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", szProto); if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) // 'hard' disabled return -1; @@ -1077,7 +1077,7 @@ INT_PTR IsProtocolEnabledService(WPARAM, LPARAM lParam) char *szProto = (char *)lParam; char dbSetting[128]; - mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", szProto); + mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", szProto); if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) return FALSE; |