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/WebView/src/webview_cleanup.cpp | 34 ++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'plugins/WebView/src/webview_cleanup.cpp') diff --git a/plugins/WebView/src/webview_cleanup.cpp b/plugins/WebView/src/webview_cleanup.cpp index 67a4ee5a1d..b645cb5e5d 100644 --- a/plugins/WebView/src/webview_cleanup.cpp +++ b/plugins/WebView/src/webview_cleanup.cpp @@ -386,7 +386,7 @@ void CodetoSymbol(char *truncated) } truncated[(position + counter) - 1] = Characters[n]; - strncpy(&truncated[position], &truncated[position + mir_strlen(CharacterCodes[n])] - 1, mir_strlen(&truncated[position]) - 1); + mir_strncpy(&truncated[position], &truncated[position + mir_strlen(CharacterCodes[n])] - 1, mir_strlen(&truncated[position]) - 1); } // end does character code exist? if (recpos == position) @@ -407,7 +407,7 @@ void EraseBlock(char *truncated) char* tempraw = (char*)malloc(MAXSIZE1); if (truncated) - strncpy(tempraw, truncated, MAXSIZE1); + mir_strncpy(tempraw, truncated, MAXSIZE1); // /////////////////////////// @@ -584,7 +584,7 @@ void EraseBlock(char *truncated) positionStart = 0; positionEnd = 0; - strncpy(truncated, tempraw, mir_strlen(truncated)); + mir_strncpy(truncated, tempraw, mir_strlen(truncated)); free(tempraw); } @@ -597,7 +597,7 @@ void EraseSymbols(char *truncated) char *tempraw = (char*)malloc(MAXSIZE1); if (truncated) - strncpy(tempraw, truncated, MAXSIZE1); + mir_strncpy(tempraw, truncated, MAXSIZE1); // ////// while (true) { @@ -625,7 +625,7 @@ void EraseSymbols(char *truncated) recpos = position; } - strncpy(truncated, tempraw, mir_strlen(truncated)); + mir_strncpy(truncated, tempraw, mir_strlen(truncated)); free(tempraw); } @@ -640,7 +640,7 @@ void NumSymbols(char *truncated) char *tempraw = (char*)malloc(MAXSIZE1); if (truncated) - strncpy(tempraw, truncated, MAXSIZE1); + mir_strncpy(tempraw, truncated, MAXSIZE1); while (true) { Sleep(1); // avoid 100% CPU @@ -678,7 +678,7 @@ void NumSymbols(char *truncated) recpos = position; } - strncpy(truncated, tempraw, mir_strlen(truncated)); + mir_strncpy(truncated, tempraw, mir_strlen(truncated)); free(tempraw); } @@ -687,7 +687,7 @@ void FastTagFilter(char *truncated) { char *tempraw = (char*)malloc(MAXSIZE1); if (truncated) - strncpy(tempraw, truncated, MAXSIZE1); + mir_strncpy(tempraw, truncated, MAXSIZE1); for (int counter = 0; counter < mir_strlen(tempraw); counter++) { if (tempraw[counter] == '<') { @@ -703,7 +703,7 @@ void FastTagFilter(char *truncated) } } - strncpy(truncated, tempraw, mir_strlen(truncated)); + mir_strncpy(truncated, tempraw, mir_strlen(truncated)); free(tempraw); } @@ -715,7 +715,7 @@ void RemoveInvis(char *truncated, int AmountWspcRem) char *tempraw = (char*)malloc(MAXSIZE1); if (truncated) - strncpy(tempraw, truncated, MAXSIZE1); + mir_strncpy(tempraw, truncated, MAXSIZE1); switch (AmountWspcRem) { case 1: @@ -745,7 +745,7 @@ void RemoveInvis(char *truncated, int AmountWspcRem) tempraw[counter] = ' '; } // end for - strncpy(truncated, tempraw, mir_strlen(truncated)); + mir_strncpy(truncated, tempraw, mir_strlen(truncated)); free(tempraw); } @@ -754,13 +754,13 @@ void RemoveTabs(char *truncated) { char *tempraw = (char*)malloc(MAXSIZE1); if (truncated) - strncpy(tempraw, truncated, MAXSIZE1); + mir_strncpy(tempraw, truncated, MAXSIZE1); for (int counter = 0; counter < mir_strlen(tempraw); counter++) if (tempraw[counter] == '\t') tempraw[counter] = ' '; - strncpy(truncated, tempraw, mir_strlen(truncated)); + mir_strncpy(truncated, tempraw, mir_strlen(truncated)); free(tempraw); } @@ -779,7 +779,7 @@ void Removewhitespace(char *truncated) counter2++; pos2 = counter2; - strncpy(&truncated[pos1], &truncated[pos2], mir_strlen(&truncated[pos1]) - 1); + mir_strncpy(&truncated[pos1], &truncated[pos2], mir_strlen(&truncated[pos1]) - 1); } // end if } // end for } @@ -788,11 +788,11 @@ void Removewhitespace(char *truncated) void Filter(char *truncated) { char tempraw[MAXSIZE1]; - strncpy(tempraw, truncated, SIZEOF(tempraw)); + mir_strncpy(tempraw, truncated, SIZEOF(tempraw)); 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], mir_strlen(&tempraw[counter]) - 1); + mir_strncpy(&tempraw[counter], &tempraw[counter + 1], mir_strlen(&tempraw[counter]) - 1); - strncpy(truncated, tempraw, mir_strlen(truncated)); + mir_strncpy(truncated, tempraw, mir_strlen(truncated)); } -- cgit v1.2.3