summaryrefslogtreecommitdiff
path: root/plugins/New_GPG/src
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-05-22 19:52:29 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-05-22 19:52:29 +0000
commitbabf7873a3fe373d60ef22b1b671d98e014d8819 (patch)
treee21dfdb68839616efbbd884dfa77a1745f1c35d7 /plugins/New_GPG/src
parenta89887eb202c99ce09107668561abce6704f9004 (diff)
replace strcpy to mir_strcpy
git-svn-id: http://svn.miranda-ng.org/main/trunk@13763 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG/src')
-rwxr-xr-xplugins/New_GPG/src/main.cpp28
-rwxr-xr-xplugins/New_GPG/src/messages.cpp10
-rwxr-xr-xplugins/New_GPG/src/options.cpp10
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp12
4 files changed, 30 insertions, 30 deletions
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp
index 451bd8af1c..f1436bee2c 100755
--- a/plugins/New_GPG/src/main.cpp
+++ b/plugins/New_GPG/src/main.cpp
@@ -1442,9 +1442,9 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
mir_free(tmp);
char *subkeytype = (char*)mir_alloc(6);
if(strstr(tmp2, "RSA"))
- strcpy(subkeytype, "RSA");
+ mir_strcpy(subkeytype, "RSA");
else if(strstr(tmp2, "DSA")) //this is useless check for now, but it will be required if someone add another key types support
- strcpy(subkeytype, "ELG-E");
+ mir_strcpy(subkeytype, "ELG-E");
f<<tmp2;
mir_free(tmp2);
f<<"\n";
@@ -2366,7 +2366,7 @@ void ImportKey()
if(s != string::npos && s2 != string::npos)
{
tmp = (char*)mir_alloc(sizeof(char)*(output.substr(s,s2-s-(uncommon?1:0)).length()+1));
- strcpy(tmp, output.substr(s,s2-s-(uncommon?1:0)).c_str());
+ mir_strcpy(tmp, output.substr(s,s2-s-(uncommon?1:0)).c_str());
mir_utf8decode(tmp, 0);
db_set_s(hcnt, szGPGModuleName, "KeyMainName", tmp);
mir_free(tmp);
@@ -2382,7 +2382,7 @@ void ImportKey()
if(output[s] == ')')
{
tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2,s-s2).length()+1));
- strcpy(tmp, output.substr(s2,s-s2).c_str());
+ mir_strcpy(tmp, output.substr(s2,s-s2).c_str());
mir_utf8decode(tmp, 0);
db_set_s(hcnt, szGPGModuleName, "KeyComment", tmp);
mir_free(tmp);
@@ -2391,7 +2391,7 @@ void ImportKey()
if(s != string::npos && s2 != string::npos)
{
tmp = (char*) mir_alloc(sizeof(char)*(output.substr(s,s2-s).length()+1));
- strcpy(tmp, output.substr(s,s2-s).c_str());
+ mir_strcpy(tmp, output.substr(s,s2-s).c_str());
mir_utf8decode(tmp, 0);
db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", tmp);
mir_free(tmp);
@@ -2400,7 +2400,7 @@ void ImportKey()
else
{
tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2,s-s2).length()+1));
- strcpy(tmp, output.substr(s2,s-s2).c_str());
+ mir_strcpy(tmp, output.substr(s2,s-s2).c_str());
mir_utf8decode(tmp, 0);
db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str());
mir_free(tmp);
@@ -2438,7 +2438,7 @@ void ImportKey()
if(s != string::npos && s2 != string::npos)
{
tmp = (char*)mir_alloc(sizeof(char)*(output.substr(s,s2-s-(uncommon?1:0)).length()+1));
- strcpy(tmp, output.substr(s,s2-s-(uncommon?1:0)).c_str());
+ mir_strcpy(tmp, output.substr(s,s2-s-(uncommon?1:0)).c_str());
mir_utf8decode(tmp, 0);
db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainName", tmp);
mir_free(tmp);
@@ -2453,7 +2453,7 @@ void ImportKey()
if(output[s] == ')')
{
tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2,s-s2).length()+1));
- strcpy(tmp, output.substr(s2,s-s2).c_str());
+ mir_strcpy(tmp, output.substr(s2,s-s2).c_str());
mir_utf8decode(tmp, 0);
db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyComment", tmp);
mir_free(tmp);
@@ -2462,7 +2462,7 @@ void ImportKey()
if(s != string::npos && s2 != string::npos)
{
tmp = (char*) mir_alloc(sizeof(char)*(output.substr(s,s2-s).length()+1));
- strcpy(tmp, output.substr(s,s2-s).c_str());
+ mir_strcpy(tmp, output.substr(s,s2-s).c_str());
mir_utf8decode(tmp, 0);
db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", tmp);
mir_free(tmp);
@@ -2471,7 +2471,7 @@ void ImportKey()
else
{
tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2,s-s2).length()+1));
- strcpy(tmp, output.substr(s2,s-s2).c_str());
+ mir_strcpy(tmp, output.substr(s2,s-s2).c_str());
mir_utf8decode(tmp, 0);
db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str());
mir_free(tmp);
@@ -2508,7 +2508,7 @@ void ImportKey()
if(s != string::npos && s2 != string::npos)
{
tmp = (char*)mir_alloc(sizeof(char)*(output.substr(s,s2-s-(uncommon?1:0)).length()+1));
- strcpy(tmp, output.substr(s,s2-s-(uncommon?1:0)).c_str());
+ mir_strcpy(tmp, output.substr(s,s2-s-(uncommon?1:0)).c_str());
mir_utf8decode(tmp, 0);
db_set_s(hContact, szGPGModuleName, "KeyMainName", tmp);
mir_free(tmp);
@@ -2523,7 +2523,7 @@ void ImportKey()
if(output[s] == ')')
{
tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2,s-s2).length()+1));
- strcpy(tmp, output.substr(s2,s-s2).c_str());
+ mir_strcpy(tmp, output.substr(s2,s-s2).c_str());
mir_utf8decode(tmp, 0);
db_set_s(hContact, szGPGModuleName, "KeyComment", tmp);
mir_free(tmp);
@@ -2532,7 +2532,7 @@ void ImportKey()
if(s != string::npos && s2 != string::npos)
{
tmp = (char*) mir_alloc(sizeof(char)*(output.substr(s,s2-s).length()+1));
- strcpy(tmp, output.substr(s,s2-s).c_str());
+ mir_strcpy(tmp, output.substr(s,s2-s).c_str());
mir_utf8decode(tmp, 0);
db_set_s(hContact, szGPGModuleName, "KeyMainEmail", tmp);
mir_free(tmp);
@@ -2541,7 +2541,7 @@ void ImportKey()
else
{
tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2,s-s2).length()+1));
- strcpy(tmp, output.substr(s2,s-s2).c_str());
+ mir_strcpy(tmp, output.substr(s2,s-s2).c_str());
mir_utf8decode(tmp, 0);
db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str());
mir_free(tmp);
diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp
index ea2b7370f3..d13bd66a3b 100755
--- a/plugins/New_GPG/src/messages.cpp
+++ b/plugins/New_GPG/src/messages.cpp
@@ -263,7 +263,7 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD flags
if(bDebugLog)
debuglog<<std::string(time_str()+": info: Failed to decrypt GPG encrypted message.");
char *tmp = (char*)mir_alloc(sizeof(char)*(str.length()+1));
- strcpy(tmp, str.c_str());
+ mir_strcpy(tmp, str.c_str());
HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags));
BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0);
db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0);
@@ -437,7 +437,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l)
else if(s2 > output.find("<", s))
s2 = output.find("<", s);
tmp = (char*)mir_alloc(output.substr(s,s2-s-1).length()+1);
- strcpy(tmp, output.substr(s,s2-s-1).c_str());
+ mir_strcpy(tmp, output.substr(s,s2-s-1).c_str());
mir_utf8decode(tmp, 0);
db_set_s(ccs->hContact, szGPGModuleName, "KeyMainName", tmp);
mir_free(tmp);
@@ -449,14 +449,14 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l)
if(output[s] == ')')
{
tmp = (char*)mir_alloc(output.substr(s2,s-s2).length()+1);
- strcpy(tmp, output.substr(s2,s-s2).c_str());
+ mir_strcpy(tmp, output.substr(s2,s-s2).c_str());
mir_utf8decode(tmp, 0);
db_set_s(ccs->hContact, szGPGModuleName, "KeyComment", tmp);
mir_free(tmp);
s+=3;
s2 = output.find(">", s);
tmp = (char*)mir_alloc(output.substr(s,s2-s).length()+1);
- strcpy(tmp, output.substr(s,s2-s).c_str());
+ mir_strcpy(tmp, output.substr(s,s2-s).c_str());
mir_utf8decode(tmp, 0);
db_set_s(ccs->hContact, szGPGModuleName, "KeyMainEmail", tmp);
mir_free(tmp);
@@ -464,7 +464,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l)
else
{
tmp = (char*)mir_alloc(output.substr(s2,s-s2).length()+1);
- strcpy(tmp, output.substr(s2,s-s2).c_str());
+ mir_strcpy(tmp, output.substr(s2,s-s2).c_str());
mir_utf8decode(tmp, 0);
db_set_s(ccs->hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str());
mir_free(tmp);
diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp
index 1e0951af35..de5178e515 100755
--- a/plugins/New_GPG/src/options.cpp
+++ b/plugins/New_GPG/src/options.cpp
@@ -964,7 +964,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
string::size_type s = output.find("gpg: key ") + mir_strlen("gpg: key ");
string::size_type s2 = output.find(":", s);
tmp2 = (char*)mir_alloc((output.substr(s,s2-s).length()+1)*sizeof(char));
- strcpy(tmp2, output.substr(s,s2-s).c_str());
+ mir_strcpy(tmp2, output.substr(s,s2-s).c_str());
mir_utf8decode(tmp2, 0);
{
if(db_mc_isMeta(hContact))
@@ -1012,7 +1012,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
if(s2 != string::npos && s != string::npos)
{
tmp2 = (char*)mir_alloc(sizeof(char)*(output.substr(s,s2-s-(uncommon?1:0)).length()+1));
- strcpy(tmp2, output.substr(s,s2-s-(uncommon?1:0)).c_str());
+ mir_strcpy(tmp2, output.substr(s,s2-s-(uncommon?1:0)).c_str());
mir_utf8decode(tmp2, 0);
if(hContact)
{
@@ -1047,7 +1047,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
if(output[s] == ')')
{
tmp2 = (char*)mir_alloc((output.substr(s2,s-s2).length()+1)*sizeof(char));
- strcpy(tmp2, output.substr(s2,s-s2).c_str());
+ mir_strcpy(tmp2, output.substr(s2,s-s2).c_str());
mir_utf8decode(tmp2, 0);
if(hContact)
{
@@ -1071,7 +1071,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
s+=3;
s2 = output.find(">", s);
tmp2 = (char*)mir_alloc((output.substr(s,s2-s).length()+1) * sizeof(char));
- strcpy(tmp2, output.substr(s,s2-s).c_str());
+ mir_strcpy(tmp2, output.substr(s,s2-s).c_str());
mir_utf8decode(tmp2, 0);
if(hContact)
{
@@ -1100,7 +1100,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
else
{
tmp2 = (char*)mir_alloc(output.substr(s2,s-s2).length()+1);
- strcpy(tmp2, output.substr(s2,s-s2).c_str());
+ mir_strcpy(tmp2, output.substr(s2,s-s2).c_str());
mir_utf8decode(tmp2, 0);
if(hContact)
{
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp
index ddd170eece..c5ca301b30 100755
--- a/plugins/New_GPG/src/utilities.cpp
+++ b/plugins/New_GPG/src/utilities.cpp
@@ -1187,7 +1187,7 @@ bool isGPGValid()
return is_valid && gpg_exists;
}
-#define NEWTSTR_MALLOC(A) (A==NULL)?NULL:strcpy((char*)mir_alloc(sizeof(char)*(mir_strlen(A)+1)),A)
+#define NEWTSTR_MALLOC(A) (A==NULL)?NULL:mir_strcpy((char*)mir_alloc(sizeof(char)*(mir_strlen(A)+1)),A)
const bool StriStr(const char *str, const char *substr)
{
@@ -1782,7 +1782,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
string::size_type s = output.find("gpg: key ") + mir_strlen("gpg: key ");
string::size_type s2 = output.find(":", s);
tmp2 = (char*)mir_alloc((output.substr(s,s2-s).length()+1) * sizeof(char));
- strcpy(tmp2, output.substr(s,s2-s).c_str());
+ mir_strcpy(tmp2, output.substr(s,s2-s).c_str());
mir_utf8decode(tmp2, 0);
db_set_s(hContact, szGPGModuleName, "KeyID", tmp2);
mir_free(tmp2);
@@ -1801,7 +1801,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
if(s2 != string::npos)
{
tmp2 = (char*)mir_alloc((output.substr(s,s2-s-1).length()+1) * sizeof(char));
- strcpy(tmp2, output.substr(s,s2-s-1).c_str());
+ mir_strcpy(tmp2, output.substr(s,s2-s-1).c_str());
mir_utf8decode(tmp2, 0);
if(hContact)
{
@@ -1816,7 +1816,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
if(output[s] == ')')
{
tmp2 = (char*)mir_alloc((output.substr(s2,s-s2).length()+1) * sizeof(char));
- strcpy(tmp2, output.substr(s2,s-s2).c_str());
+ mir_strcpy(tmp2, output.substr(s2,s-s2).c_str());
mir_utf8decode(tmp2, 0);
if(hContact)
db_set_s(hContact, szGPGModuleName, "KeyComment", output.substr(s2,s-s2).c_str());
@@ -1824,7 +1824,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
s+=3;
s2 = output.find(">", s);
tmp2 = (char*)mir_alloc((output.substr(s,s2-s).length()+1) * sizeof(char));
- strcpy(tmp2, output.substr(s,s2-s).c_str());
+ mir_strcpy(tmp2, output.substr(s,s2-s).c_str());
mir_utf8decode(tmp2, 0);
if(hContact)
db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str());
@@ -1833,7 +1833,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
else
{
tmp2 = (char*)mir_alloc((output.substr(s2,s-s2).length()+1) * sizeof(char));
- strcpy(tmp2, output.substr(s2,s-s2).c_str());
+ mir_strcpy(tmp2, output.substr(s2,s-s2).c_str());
mir_utf8decode(tmp2, 0);
if(hContact)
db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str());