summaryrefslogtreecommitdiff
path: root/plugins/WebView
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-11-30 18:51:36 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-11-30 18:51:36 +0000
commit688f55ba998c19304a29727c910504903f4cc49a (patch)
tree69121ebb6d02bcf9e670428b11813087fc7f1640 /plugins/WebView
parent4f0e30cdf56fbafdf955bbe8b93930bab9e39bd0 (diff)
lstr* replacements
git-svn-id: http://svn.miranda-ng.org/main/trunk@11176 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/WebView')
-rw-r--r--plugins/WebView/src/webview.cpp6
-rw-r--r--plugins/WebView/src/webview_alerts.cpp4
-rw-r--r--plugins/WebView/src/webview_cleanup.cpp12
-rw-r--r--plugins/WebView/src/webview_datawnd.cpp4
-rw-r--r--plugins/WebView/src/webview_getdata.cpp16
-rw-r--r--plugins/WebView/src/webview_services.cpp8
6 files changed, 24 insertions, 26 deletions
diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp
index 3329dcfe3a..61904d5a9e 100644
--- a/plugins/WebView/src/webview.cpp
+++ b/plugins/WebView/src/webview.cpp
@@ -252,10 +252,10 @@ int SendToRichEdit(HWND hWindow, char *truncated, COLORREF rgbText, COLORREF rgb
cfFM.dwEffects = bold | italic | underline;
if (!db_get_ts(NULL, MODULENAME, FONT_FACE_KEY, &dbv)) {
- lstrcpy(cfFM.szFaceName, dbv.ptszVal);
+ mir_tstrcpy(cfFM.szFaceName, dbv.ptszVal);
db_free(&dbv);
}
- else lstrcpy(cfFM.szFaceName, Def_font_face);
+ else mir_tstrcpy(cfFM.szFaceName, Def_font_face);
HDC hDC = GetDC(hWindow);
cfFM.yHeight = (BYTE)MulDiv(abs(lf.lfHeight), 120, GetDeviceCaps(GetDC(hWindow), LOGPIXELSY)) * (db_get_b(NULL, MODULENAME, FONT_SIZE_KEY, 14));
@@ -338,7 +338,7 @@ void FontSettings(void)
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf.lfQuality = DEFAULT_QUALITY;
lf.lfPitchAndFamily = FIXED_PITCH | FF_MODERN;
- lstrcpy(lf.lfFaceName, Def_font_face);
+ mir_tstrcpy(lf.lfFaceName, Def_font_face);
}
/*****************************************************************************/
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp
index 35378816ba..6d879a0b42 100644
--- a/plugins/WebView/src/webview_alerts.cpp
+++ b/plugins/WebView/src/webview_alerts.cpp
@@ -116,10 +116,10 @@ int PopupAlert(WPARAM wParam, LPARAM lParam)
if( ((HANDLE)wParam) != NULL) {
DBVARIANT dbv;
db_get_ts(wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv);
- lstrcpyn(ppd.lptzContactName, dbv.ptszVal, SIZEOF(ppd.lptzContactName));
+ mir_tstrncpy(ppd.lptzContactName, dbv.ptszVal, SIZEOF(ppd.lptzContactName));
db_free(&dbv);
}
- else lstrcpy(ppd.lptzContactName, _T(MODULENAME));
+ else mir_tstrcpy(ppd.lptzContactName, _T(MODULENAME));
ppd.lchContact = wParam;
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
diff --git a/plugins/WebView/src/webview_cleanup.cpp b/plugins/WebView/src/webview_cleanup.cpp
index bf34ef46d5..f6336cb83f 100644
--- a/plugins/WebView/src/webview_cleanup.cpp
+++ b/plugins/WebView/src/webview_cleanup.cpp
@@ -689,10 +689,10 @@ void FastTagFilter(char *truncated)
if (truncated)
strncpy(tempraw, truncated, MAXSIZE1);
- for (int counter = 0; counter < lstrlenA(tempraw); counter++) {
+ for (int counter = 0; counter < mir_strlen(tempraw); counter++) {
if (tempraw[counter] == '<') {
while (tempraw[counter] != '>') {
- if (counter >= lstrlenA(tempraw))
+ if (counter >= mir_strlen(tempraw))
break;
tempraw[counter] = ' ';
@@ -729,7 +729,7 @@ void RemoveInvis(char *truncated, int AmountWspcRem)
break;
}
- for (int counter = 0; counter < lstrlenA(tempraw); counter++) {
+ for (int counter = 0; counter < mir_strlen(tempraw); counter++) {
if (AmountWspcRem != 0 && AmountWspcRem != 4) {
if ((tempraw[counter] == '\n') || (tempraw[counter] == ' ') || (tempraw[counter] == '\r'))
erase = erase + 1;
@@ -756,7 +756,7 @@ void RemoveTabs(char *truncated)
if (truncated)
strncpy(tempraw, truncated, MAXSIZE1);
- for (int counter = 0; counter < lstrlenA(tempraw); counter++)
+ for (int counter = 0; counter < mir_strlen(tempraw); counter++)
if (tempraw[counter] == '\t')
tempraw[counter] = ' ';
@@ -770,7 +770,7 @@ void Removewhitespace(char *truncated)
int counter2 = 0;
int pos1 = 0, pos2 = 0;
- for (int counter = 0; counter < lstrlenA(truncated); counter++) {
+ for (int counter = 0; counter < mir_strlen(truncated); counter++) {
if (truncated[counter] == ' ' && truncated[counter + 1] == ' ') {
pos1 = counter + 1;
counter2 = counter;
@@ -790,7 +790,7 @@ void Filter(char *truncated)
char tempraw[MAXSIZE1];
strncpy(tempraw, truncated, SIZEOF(tempraw));
- for (int counter = 0; counter < lstrlenA(tempraw); counter++)
+ for (int counter = 0; counter < mir_strlen(tempraw); counter++)
if ((tempraw[counter] == '\n') || (tempraw[counter] == '\r') || (tempraw[counter] == '\t'))
strncpy(&tempraw[counter], &tempraw[counter + 1], strlen(&tempraw[counter]) - 1);
diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp
index a7dee35823..2731f9a263 100644
--- a/plugins/WebView/src/webview_datawnd.cpp
+++ b/plugins/WebView/src/webview_datawnd.cpp
@@ -62,10 +62,10 @@ INT_PTR CALLBACK DlgProcFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
free(tempbuffer);
Filter(buff);
- CharUpperBuffA(buff, lstrlenA(buff));
+ CharUpperBuffA(buff, mir_strlen(buff));
GetDlgItemTextA(hwndDlg, IDC_FINDWHAT, NewSearchstr, SIZEOF(NewSearchstr));
- CharUpperBuffA(NewSearchstr, lstrlenA(NewSearchstr));
+ CharUpperBuffA(NewSearchstr, mir_strlen(NewSearchstr));
OLDstartposition = startposition;
diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp
index eef98ee250..9de894fd3e 100644
--- a/plugins/WebView/src/webview_getdata.cpp
+++ b/plugins/WebView/src/webview_getdata.cpp
@@ -37,7 +37,6 @@ void GetData(void *param)
int MallocSize = 0;
int DownloadSuccess = 0;
char*raw;
- char*szInfo;
char truncated[MAXSIZE1];
char truncated2[MAXSIZE2];
int trunccount = 0;
@@ -64,7 +63,6 @@ void GetData(void *param)
ZeroMemory(&contactname, sizeof(contactname));
ZeroMemory(&tempstring, sizeof(tempstring));
ZeroMemory(&tempstring2, sizeof(tempstring2));
- ZeroMemory(&szInfo, sizeof(szInfo));
ZeroMemory(&dbv, sizeof(dbv));
ZeroMemory(&tstr, sizeof(tstr));
ZeroMemory(&timestring, sizeof(timestring));
@@ -148,13 +146,13 @@ void GetData(void *param)
db_set_ts(hContact, "CList", "StatusMsg", statusText);
}
if (nlhrReply->dataLength) {
- int cbLen = lstrlenA(nlhrReply->pData);
- szInfo = (char*)malloc(cbLen + 2);
- lstrcpynA(szInfo, nlhrReply->pData, cbLen);
- downloadsize = lstrlenA(nlhrReply->pData);
+ size_t cbLen = mir_strlen(nlhrReply->pData);
+ char *szInfo = (char*)malloc(cbLen + 2);
+ mir_strncpy(szInfo, nlhrReply->pData, cbLen);
+ downloadsize = mir_strlen(nlhrReply->pData);
trunccount = 0;
- lstrcpynA(truncated2, szInfo, MAXSIZE2);
+ mir_strncpy(truncated2, szInfo, MAXSIZE2);
free(szInfo);
////////////////////////////////////////////
@@ -193,7 +191,7 @@ void GetData(void *param)
if (DownloadSuccess) {
// all the site
if (db_get_b(hContact, MODULENAME, U_ALLSITE_KEY, 0) == 1)
- lstrcpynA(truncated, truncated2, MAXSIZE1);
+ mir_strncpy(truncated, truncated2, MAXSIZE1);
else { // use start and end string
// putting data into string
if (((strstr(truncated2, tempstring)) != 0) && ((strstr(truncated2, tempstring2)) != 0)) {
@@ -240,7 +238,7 @@ void GetData(void *param)
trunccount = 0;
- lstrcpynA(truncated, raw, MAXSIZE1);
+ mir_strncpy(truncated, raw, MAXSIZE1);
free(raw);
diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp
index 1b9e8ae0e7..924b8ab9e6 100644
--- a/plugins/WebView/src/webview_services.cpp
+++ b/plugins/WebView/src/webview_services.cpp
@@ -225,7 +225,7 @@ INT_PTR GetCaps(WPARAM wParam, LPARAM)
INT_PTR GetName(WPARAM wParam, LPARAM lParam)
{
- lstrcpynA((char*) lParam, MODULENAME, wParam);
+ mir_strncpy((char*) lParam, MODULENAME, wParam);
return 0;
}
@@ -248,7 +248,7 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam)
bpStatus = wParam;
ProtoBroadcastAck(MODULENAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, wParam);
-
+
// Make sure no contact has offline status for any reason on first time run
if ( db_get_b(NULL, MODULENAME, "FirstTime", 100) == 100) {
for (MCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME))
@@ -319,12 +319,12 @@ INT_PTR BasicSearch(WPARAM wParam, LPARAM lParam)
static TCHAR buf[300];
if (lParam)
- lstrcpyn(buf, (const TCHAR*) lParam, 256);
+ mir_tstrncpy(buf, (const TCHAR*) lParam, 256);
if (searchId != -1)
return 0; // only one search at a time
- lstrcpyn(sID, (TCHAR*)lParam, SIZEOF(sID));
+ mir_tstrncpy(sID, (TCHAR*)lParam, SIZEOF(sID));
searchId = 1;
// create a thread for the ID search