From 6fcfba2c46a456677b5825a899469ba4e8905448 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 23 May 2015 17:49:58 +0000 Subject: replace strncpy to mir_strncpy git-svn-id: http://svn.miranda-ng.org/main/trunk@13785 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TipperYM/src/mir_smileys.cpp | 6 +++--- plugins/TipperYM/src/options.cpp | 10 +++++----- plugins/TipperYM/src/popwin.cpp | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'plugins/TipperYM/src') diff --git a/plugins/TipperYM/src/mir_smileys.cpp b/plugins/TipperYM/src/mir_smileys.cpp index a6ac7e8cd9..6fd7cbf805 100644 --- a/plugins/TipperYM/src/mir_smileys.cpp +++ b/plugins/TipperYM/src/mir_smileys.cpp @@ -314,11 +314,11 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco char smileyProto[64]; if (protocol == NULL) - strncpy(smileyProto, "tipper", sizeof(smileyProto) - 1); + mir_strncpy(smileyProto, "tipper", sizeof(smileyProto) - 1); else if (mir_strcmp(protocol, META_PROTO) == 0) - strncpy(smileyProto, "tipper", sizeof(smileyProto) - 1); + mir_strncpy(smileyProto, "tipper", sizeof(smileyProto) - 1); else - strncpy(smileyProto, protocol, sizeof(smileyProto) - 1); + mir_strncpy(smileyProto, protocol, sizeof(smileyProto) - 1); // Parse it! SMADD_BATCHPARSE2 sp = { 0 }; diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 85ca77b699..14d46e1855 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -69,7 +69,7 @@ void CreateDefaultItems() DSListNode *ds_node = (DSListNode *)mir_alloc(sizeof(DSListNode)); _tcsncpy(ds_node->ds.swzName, subst->swzName, LABEL_LEN); ds_node->ds.type = subst->type; - strncpy(ds_node->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN); + mir_strncpy(ds_node->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN); ds_node->ds.iTranslateFuncId = subst->iTranslateFuncId; ds_node->next = opt.dsList; opt.dsList = ds_node; @@ -110,7 +110,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index) mir_snprintf(setting, SIZEOF(setting), "Module%d", index); ds->szModuleName[0] = 0; if (!db_get(0, MODULE_ITEMS, setting, &dbv)) { - strncpy(ds->szModuleName, dbv.pszVal, MODULE_NAME_LEN); + mir_strncpy(ds->szModuleName, dbv.pszVal, MODULE_NAME_LEN); ds->szModuleName[MODULE_NAME_LEN - 1] = 0; db_free(&dbv); } @@ -118,7 +118,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index) mir_snprintf(setting, SIZEOF(setting), "Setting%d", index); ds->szSettingName[0] = 0; if (!db_get(0, MODULE_ITEMS, setting, &dbv)) { - strncpy(ds->szSettingName, dbv.pszVal, SETTING_NAME_LEN); + mir_strncpy(ds->szSettingName, dbv.pszVal, SETTING_NAME_LEN); ds->szSettingName[SETTING_NAME_LEN - 1] = 0; db_free(&dbv); } @@ -910,10 +910,10 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA _tcsncpy(ds_value->ds.swzName, subst->swzName, LABEL_LEN - 1); if (ds_value->ds.type == DVT_DB && subst->szModuleName) - strncpy(ds_value->ds.szModuleName, subst->szModuleName, MODULE_NAME_LEN - 1); + mir_strncpy(ds_value->ds.szModuleName, subst->szModuleName, MODULE_NAME_LEN - 1); if (subst->szSettingName) - strncpy(ds_value->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN - 1); + mir_strncpy(ds_value->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN - 1); ds_value->ds.iTranslateFuncId = subst->iTranslateFuncId; diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 1396836639..11fa12f1e5 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -338,9 +338,9 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (iXstatus) { char szIconProto[64]; if (mir_strcmp(szProto, META_PROTO) != 0) - strncpy(szIconProto, szProto, sizeof(szIconProto) - 1); + mir_strncpy(szIconProto, szProto, sizeof(szIconProto) - 1); else if (!db_get_s(pwd->hContact, szProto, "XStatusProto", &dbv)) { - strncpy(szIconProto, dbv.pszVal, sizeof(szIconProto) - 1); + mir_strncpy(szIconProto, dbv.pszVal, sizeof(szIconProto) - 1); db_free(&dbv); } -- cgit v1.2.3