From 5a17c9299e03bebf46169927abdeee34aaf8e854 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 22 May 2015 10:06:32 +0000 Subject: replace strlen to mir_strlen git-svn-id: http://svn.miranda-ng.org/main/trunk@13747 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/WebView/src/webview_alerts.cpp | 20 ++++++++++---------- plugins/WebView/src/webview_cleanup.cpp | 22 +++++++++++----------- plugins/WebView/src/webview_datawnd.cpp | 12 ++++++------ plugins/WebView/src/webview_getdata.cpp | 16 ++++++++-------- 4 files changed, 35 insertions(+), 35 deletions(-) (limited to 'plugins/WebView') diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index 8592a9ac9c..92679003b7 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -243,7 +243,7 @@ void SaveToFile(MCONTACT hContact, char *truncated) mir_snprintf(timestring, SIZEOF(timestring), "(%s)%s\n%s,%s\n", MODULENAME, url, temptime1, temptime2); fputs(timestring, pfile); - fwrite(truncated, strlen(truncated), 1, pfile); + fwrite(truncated, mir_strlen(truncated), 1, pfile); fputs("\n\n", pfile); fclose(pfile); } @@ -443,13 +443,13 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn if ((pcachefile = _tfopen(newcachepath, _T("w"))) == NULL) WErrorPopup((MCONTACT)contactname, TranslateT("Cannot write to file 1")); else { - fwrite(tempraw, strlen(tempraw), 1, pcachefile); //smaller cache + fwrite(tempraw, mir_strlen(tempraw), 1, pcachefile); //smaller cache fclose(pcachefile); db_set_ts(hContact, MODULENAME, CACHE_FILE_KEY, newcachepath); } // end write to cache - if (strncmp(tempraw, cachecompare, strlen(tempraw)) != 0) { //lets try this instead + if (strncmp(tempraw, cachecompare, mir_strlen(tempraw)) != 0) { //lets try this instead // play sound? SkinPlaySound("webviewalert"); // there was an alert @@ -533,13 +533,13 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn memset(&alertpos, 0, sizeof(alertpos)); //end string alertpos = strstr(tempraw, Alerttempstring2); - statalertposend = alertpos - tempraw + (int)strlen(Alerttempstring2); + statalertposend = alertpos - tempraw + (int)mir_strlen(Alerttempstring2); if (statalertpos > statalertposend) { memset(&tempraw, ' ', statalertpos); memset(&alertpos, 0, sizeof(alertpos)); alertpos = strstr(tempraw, Alerttempstring2); - statalertposend = alertpos - tempraw + (int)strlen(Alerttempstring2); + statalertposend = alertpos - tempraw + (int)mir_strlen(Alerttempstring2); } if (statalertpos < statalertposend) { @@ -551,13 +551,13 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn //end string alertpos = strstr(tempraw, Alerttempstring2); - statalertposend = alertpos - tempraw + (int)strlen(Alerttempstring2); + statalertposend = alertpos - tempraw + (int)mir_strlen(Alerttempstring2); if (statalertpos > statalertposend) { memset(&tempraw, ' ', statalertpos); memset(&alertpos, 0, sizeof(alertpos)); alertpos = strstr(tempraw, Alerttempstring2); - statalertposend = alertpos - tempraw + (int)strlen(Alerttempstring2); + statalertposend = alertpos - tempraw + (int)mir_strlen(Alerttempstring2); } disalertpos = 0; @@ -655,12 +655,12 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn if ((pcachefile = _tfopen(newcachepath, _T("w"))) == NULL) WErrorPopup((MCONTACT)contactname, TranslateT("Cannot write to file 2")); else { - fwrite(raw, strlen(raw), 1, pcachefile); //smaller cache + fwrite(raw, mir_strlen(raw), 1, pcachefile); //smaller cache db_set_ts(hContact, MODULENAME, CACHE_FILE_KEY, newcachepath); fclose(pcachefile); } // end write to cache - if (strncmp(raw, cachecompare, (strlen(raw))) != 0) { //lets try this instead + if (strncmp(raw, cachecompare, (mir_strlen(raw))) != 0) { //lets try this instead // play sound? SkinPlaySound("webviewalert"); // there was an alert @@ -760,7 +760,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn } } } - strncpy(truncated, tempraw, strlen(truncated)); + strncpy(truncated, tempraw, mir_strlen(truncated)); return wasAlert; } diff --git a/plugins/WebView/src/webview_cleanup.cpp b/plugins/WebView/src/webview_cleanup.cpp index f6336cb83f..67a4ee5a1d 100644 --- a/plugins/WebView/src/webview_cleanup.cpp +++ b/plugins/WebView/src/webview_cleanup.cpp @@ -380,13 +380,13 @@ void CodetoSymbol(char *truncated) position = stringfrompos - truncated; counter = 0; - while (counter != strlen(CharacterCodes[n])) { + while (counter != mir_strlen(CharacterCodes[n])) { truncated[position + counter] = ' '; counter++; } truncated[(position + counter) - 1] = Characters[n]; - strncpy(&truncated[position], &truncated[position + strlen(CharacterCodes[n])] - 1, strlen(&truncated[position]) - 1); + strncpy(&truncated[position], &truncated[position + mir_strlen(CharacterCodes[n])] - 1, mir_strlen(&truncated[position]) - 1); } // end does character code exist? if (recpos == position) @@ -584,7 +584,7 @@ void EraseBlock(char *truncated) positionStart = 0; positionEnd = 0; - strncpy(truncated, tempraw, strlen(truncated)); + strncpy(truncated, tempraw, mir_strlen(truncated)); free(tempraw); } @@ -625,7 +625,7 @@ void EraseSymbols(char *truncated) recpos = position; } - strncpy(truncated, tempraw, strlen(truncated)); + strncpy(truncated, tempraw, mir_strlen(truncated)); free(tempraw); } @@ -678,7 +678,7 @@ void NumSymbols(char *truncated) recpos = position; } - strncpy(truncated, tempraw, strlen(truncated)); + strncpy(truncated, tempraw, mir_strlen(truncated)); free(tempraw); } @@ -703,7 +703,7 @@ void FastTagFilter(char *truncated) } } - strncpy(truncated, tempraw, strlen(truncated)); + strncpy(truncated, tempraw, mir_strlen(truncated)); free(tempraw); } @@ -745,7 +745,7 @@ void RemoveInvis(char *truncated, int AmountWspcRem) tempraw[counter] = ' '; } // end for - strncpy(truncated, tempraw, strlen(truncated)); + strncpy(truncated, tempraw, mir_strlen(truncated)); free(tempraw); } @@ -760,7 +760,7 @@ void RemoveTabs(char *truncated) if (tempraw[counter] == '\t') tempraw[counter] = ' '; - strncpy(truncated, tempraw, strlen(truncated)); + strncpy(truncated, tempraw, mir_strlen(truncated)); free(tempraw); } @@ -779,7 +779,7 @@ void Removewhitespace(char *truncated) counter2++; pos2 = counter2; - strncpy(&truncated[pos1], &truncated[pos2], strlen(&truncated[pos1]) - 1); + strncpy(&truncated[pos1], &truncated[pos2], mir_strlen(&truncated[pos1]) - 1); } // end if } // end for } @@ -792,7 +792,7 @@ void Filter(char *truncated) 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); + strncpy(&tempraw[counter], &tempraw[counter + 1], mir_strlen(&tempraw[counter]) - 1); - strncpy(truncated, tempraw, strlen(truncated)); + strncpy(truncated, tempraw, mir_strlen(truncated)); } diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index 0f98327ede..6982a6b8ef 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -62,15 +62,15 @@ INT_PTR CALLBACK DlgProcFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara free(tempbuffer); Filter(buff); - CharUpperBuffA(buff, (int)strlen(buff)); + CharUpperBuffA(buff, (int)mir_strlen(buff)); GetDlgItemTextA(hwndDlg, IDC_FINDWHAT, NewSearchstr, SIZEOF(NewSearchstr)); - CharUpperBuffA(NewSearchstr, (int)strlen(NewSearchstr)); + CharUpperBuffA(NewSearchstr, (int)mir_strlen(NewSearchstr)); OLDstartposition = startposition; if ((strstr(Searchstr, NewSearchstr)) != 0) - startposition = loc + (int)strlen(Searchstr); + startposition = loc + (int)mir_strlen(Searchstr); else { oldloc = 0; startposition = 0; @@ -78,7 +78,7 @@ INT_PTR CALLBACK DlgProcFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara strcpy(Searchstr, NewSearchstr); - if (!(startposition > strlen(buff))) + if (!(startposition > mir_strlen(buff))) location = (strstr(buff + startposition, NewSearchstr)) - buff; oldloc = loc; @@ -88,14 +88,14 @@ INT_PTR CALLBACK DlgProcFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara ShowWindow(GetDlgItem(hwndDlg, IDC_SEARCH_COMPLETE), SW_SHOW); loc = (strstr(buff, NewSearchstr)) - buff; startsel = loc; - endsel = loc + (int)strlen(NewSearchstr); + endsel = loc + (int)mir_strlen(NewSearchstr); oldloc = 0; startposition = 0; } else { ShowWindow(GetDlgItem(hwndDlg, IDC_SEARCH_COMPLETE), SW_HIDE); startsel = loc; - endsel = loc + (int)strlen(NewSearchstr); + endsel = loc + (int)mir_strlen(NewSearchstr); } CHARRANGE sel2 = {startsel, endsel}; diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp index 5563711733..a542e21c0a 100644 --- a/plugins/WebView/src/webview_getdata.cpp +++ b/plugins/WebView/src/webview_getdata.cpp @@ -101,7 +101,7 @@ void GetData(void *param) db_free(&dbv); } - if (strlen(url) < 3) + if (mir_strlen(url) < 3) WErrorPopup(hContact, TranslateT("URL not supplied")); NETLIBHTTPREQUEST nlhr = { sizeof(nlhr) }; @@ -194,13 +194,13 @@ void GetData(void *param) memset(&pos, 0, sizeof(pos)); // XXX: looks bad. // end string pos = strstr(truncated2, tempstring2); - statposend = pos - truncated2 + (int)strlen(tempstring2); + statposend = pos - truncated2 + (int)mir_strlen(tempstring2); if (statpos > statposend) { memset(&truncated2, ' ', statpos); memset(&pos, 0, sizeof(pos)); // XXX: looks bad. pos = strstr(truncated2, tempstring2); - statposend = pos - truncated2 + (int)strlen(tempstring2); + statposend = pos - truncated2 + (int)mir_strlen(tempstring2); } if (statpos < statposend) { memset(&raw, 0, sizeof(raw)); @@ -215,13 +215,13 @@ void GetData(void *param) // end string pos = strstr(truncated2, tempstring2); - statposend = pos - truncated2 + (int)strlen(tempstring2); + statposend = pos - truncated2 + (int)mir_strlen(tempstring2); if (statpos > statposend) { memset(&truncated2, ' ', statpos); memset(&pos, 0, sizeof(pos)); // XXX pos = strstr(truncated2, tempstring2); - statposend = pos - truncated2 + (int)strlen(tempstring2); + statposend = pos - truncated2 + (int)mir_strlen(tempstring2); } dispos = 0; @@ -437,13 +437,13 @@ LBL_Stop: TCHAR *statusText = TranslateT("Processing data stopped by user."); goto LBL_Stop; // removed any excess characters at the end. - if ((truncated[strlen(truncated) - 1] == truncated[strlen(truncated) - 2]) && (truncated[strlen(truncated) - 2] == truncated[strlen(truncated) - 3])) { + if ((truncated[mir_strlen(truncated) - 1] == truncated[mir_strlen(truncated) - 2]) && (truncated[mir_strlen(truncated) - 2] == truncated[mir_strlen(truncated) - 3])) { int counterx = 0; while (true) { counterx++; - if (truncated[strlen(truncated) - counterx] != truncated[strlen(truncated) - 1]) { - truncated[(strlen(truncated) - counterx) + 2] = '\0'; + if (truncated[mir_strlen(truncated) - counterx] != truncated[mir_strlen(truncated) - 1]) { + truncated[(mir_strlen(truncated) - counterx) + 2] = '\0'; break; } } -- cgit v1.2.3