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/WhenWasIt/src/utils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/WhenWasIt') diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp index 42bf4be905..5d78e81a7b 100644 --- a/plugins/WhenWasIt/src/utils.cpp +++ b/plugins/WhenWasIt/src/utils.cpp @@ -94,14 +94,14 @@ void HexToBin(char *inData, ULONG &size, LPBYTE &outData) { char buffer[32] = { 0 }; mir_strcpy(buffer, "0x"); - strncpy(buffer + 2, inData, HEX_SIZE); + mir_strncpy(buffer + 2, inData, HEX_SIZE); sscanf(buffer, "%x", &size); outData = (unsigned char*)new char[size * 2]; char *tmp = inData + HEX_SIZE; buffer[4] = '\0'; //mark the end of the string for (UINT i = 0; i < size; i++) { - strncpy(buffer + 2, &tmp[i * 2], 2); + mir_strncpy(buffer + 2, &tmp[i * 2], 2); sscanf(buffer, "%x", &outData[i]); } } @@ -116,7 +116,7 @@ int GetStringFromDatabase(MCONTACT hContact, char *szModule, char *szSettingName res = 0; size_t tmp = mir_strlen(dbv.pszVal); len = (tmp < size - 1) ? tmp : size - 1; - strncpy(szResult, dbv.pszVal, len); + mir_strncpy(szResult, dbv.pszVal, len); szResult[len] = '\0'; mir_free(dbv.pszVal); } @@ -125,7 +125,7 @@ int GetStringFromDatabase(MCONTACT hContact, char *szModule, char *szSettingName if (szError) { size_t tmp = mir_strlen(szError); len = (tmp < size - 1) ? tmp : size - 1; - strncpy(szResult, szError, len); + mir_strncpy(szResult, szError, len); szResult[len] = '\0'; } else szResult[0] = '\0'; -- cgit v1.2.3