summaryrefslogtreecommitdiff
path: root/plugins/New_GPG
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-05-22 10:06:32 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-05-22 10:06:32 +0000
commit5a17c9299e03bebf46169927abdeee34aaf8e854 (patch)
treecbd13080f33ac0b6396b9d3b8ba31a3c98de59f8 /plugins/New_GPG
parented64312924e77707e7e5b5965c301692519f293a (diff)
replace strlen to mir_strlen
git-svn-id: http://svn.miranda-ng.org/main/trunk@13747 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG')
-rwxr-xr-xplugins/New_GPG/src/main.cpp36
-rwxr-xr-xplugins/New_GPG/src/messages.cpp4
-rwxr-xr-xplugins/New_GPG/src/options.cpp10
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp22
-rw-r--r--plugins/New_GPG/src/utilities.h10
5 files changed, 41 insertions, 41 deletions
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp
index 0437587688..ed3737b847 100755
--- a/plugins/New_GPG/src/main.cpp
+++ b/plugins/New_GPG/src/main.cpp
@@ -142,7 +142,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
creation_date = mir_wstrdup(toUTF16(out.substr(p,p2-p)).c_str());
p2 = out.find("[", p2);
p2 = out.find("expires:", p2);
- p2 += strlen("expires:");
+ p2 += mir_strlen("expires:");
if(p2 != std::string::npos)
{
p2++;
@@ -270,7 +270,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
string keyinfo = Translate("key ID");
keyinfo += ": ";
char *keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", "");
- keyinfo += (strlen(keyid) > 0)?keyid:Translate("not set");
+ keyinfo += (mir_strlen(keyid) > 0)?keyid:Translate("not set");
mir_free(keyid);
SetDlgItemTextA(hwndDlg, IDC_KEY_ID, keyinfo.c_str());
}
@@ -468,7 +468,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
if(result == pxNotFound)
break;
string::size_type s = out.find("Key fingerprint = ");
- s += strlen("Key fingerprint = ");
+ s += mir_strlen("Key fingerprint = ");
string::size_type s2 = out.find("\n", s);
TCHAR *fp = NULL;
{
@@ -655,7 +655,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
string keyinfo = Translate("key ID");
keyinfo += ": ";
char *keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", "");
- keyinfo += (strlen(keyid) > 0)?keyid:Translate("not set");
+ keyinfo += (mir_strlen(keyid) > 0)?keyid:Translate("not set");
mir_free(keyid);
SetDlgItemTextA(hwndDlg, IDC_KEY_ID, keyinfo.c_str());
}
@@ -666,7 +666,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
std::string acc_str= buf;
acc_str += "_KeyID";
char *keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, acc_str.c_str(), "");
- keyinfo += (strlen(keyid) > 0)?keyid:Translate("not set");
+ keyinfo += (mir_strlen(keyid) > 0)?keyid:Translate("not set");
mir_free(keyid);
SetDlgItemTextA(hwndDlg, IDC_KEY_ID, keyinfo.c_str());
}
@@ -913,7 +913,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
string::size_type p1 = out.find("(GnuPG) ");
if(p1 != string::npos)
{
- p1 += strlen("(GnuPG) ");
+ p1 += mir_strlen("(GnuPG) ");
if(out[p1] != '1')
bad_version = true;
}
@@ -974,7 +974,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
char* p_path = NULL;
if(StriStr(atmp, mir_path))
{
- p_path = atmp + strlen(mir_path);
+ p_path = atmp + mir_strlen(mir_path);
tmp = mir_a2t(p_path);
SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp);
}
@@ -992,7 +992,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
char* p_path = NULL;
if(StriStr(atmp, mir_path))
{
- p_path = atmp + strlen(mir_path);
+ p_path = atmp + mir_strlen(mir_path);
tmp = mir_a2t(p_path);
SetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp);
}
@@ -1038,7 +1038,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
string::size_type p1 = out.find("(GnuPG) ");
if(p1 != string::npos)
{
- p1 += strlen("(GnuPG) ");
+ p1 += mir_strlen("(GnuPG) ");
if(out[p1] != '1')
bad_version = true;
}
@@ -1116,7 +1116,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
string::size_type p1 = out.find("(GnuPG) ");
if(p1 != string::npos)
{
- p1 += strlen("(GnuPG) ");
+ p1 += mir_strlen("(GnuPG) ");
if(out[p1] != '1')
bad_version = true;
}
@@ -1747,7 +1747,7 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wPar
p2 = p3;
p2--;
p3++;
- p3+=strlen("expires: ");
+ p3+=mir_strlen("expires: ");
string::size_type p4 = out.find("]", p3);
tmp = mir_wstrdup(toUTF16(out.substr(p3,p4-p3)).c_str());
ListView_SetItemText(hwndList, iRow, 4, tmp);
@@ -1759,7 +1759,7 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wPar
ListView_SetItemText(hwndList, iRow, 3, tmp);
mir_free(tmp);
p = out.find("uid ", p);
- p+= strlen("uid ");
+ p+= mir_strlen("uid ");
p2 = out.find("\n", p);
p3 = out.substr(p, p2-p).find("<");
if(p3 != string::npos)
@@ -1833,7 +1833,7 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wPar
p2 = out.find("-----END PGP PUBLIC KEY BLOCK-----", p1);
if(p2 != std::string::npos)
{
- p2 += strlen("-----END PGP PUBLIC KEY BLOCK-----");
+ p2 += mir_strlen("-----END PGP PUBLIC KEY BLOCK-----");
out = out.substr(p1, p2-p1);
TCHAR *tmp = mir_a2t(out.c_str());
SetWindowText(hPubKeyEdit, tmp);
@@ -2121,7 +2121,7 @@ void InitCheck()
if((p != std::string::npos) && (p < p2))
{
p = out.find("expires:", p);
- p += strlen("expires:");
+ p += mir_strlen("expires:");
p++;
p2 = out.find("]", p);
TCHAR *expire_date = mir_wstrdup(toUTF16(out.substr(p,p2-p)).c_str());
@@ -2188,7 +2188,7 @@ void InitCheck()
if((p != std::string::npos) && (p < p2))
{
p = out.find("expires:", p);
- p += strlen("expires:");
+ p += mir_strlen("expires:");
p++;
p2 = out.find("]", p);
TCHAR *expire_date = mir_wstrdup(toUTF16(out.substr(p,p2-p)).c_str());
@@ -2341,7 +2341,7 @@ void ImportKey()
if(hcnt)
{
char *tmp = NULL;
- string::size_type s = output.find("gpg: key ") + strlen("gpg: key ");
+ string::size_type s = output.find("gpg: key ") + mir_strlen("gpg: key ");
string::size_type s2 = output.find(":", s);
db_set_s(hcnt, szGPGModuleName, "KeyID", output.substr(s,s2-s).c_str());
s = output.find("“", s2);
@@ -2413,7 +2413,7 @@ void ImportKey()
else
{
char *tmp = NULL;
- string::size_type s = output.find("gpg: key ") + strlen("gpg: key ");
+ string::size_type s = output.find("gpg: key ") + mir_strlen("gpg: key ");
string::size_type s2 = output.find(":", s);
db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyID", output.substr(s,s2-s).c_str());
s = output.find("“", s2);
@@ -2483,7 +2483,7 @@ void ImportKey()
else
{
char *tmp = NULL;
- string::size_type s = output.find("gpg: key ") + strlen("gpg: key ");
+ string::size_type s = output.find("gpg: key ") + mir_strlen("gpg: key ");
string::size_type s2 = output.find(":", s);
db_set_s(hContact, szGPGModuleName, "KeyID", output.substr(s,s2-s).c_str());
s = output.find("“", s2);
diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp
index 70a4b0c450..b29af2b1d4 100755
--- a/plugins/New_GPG/src/messages.cpp
+++ b/plugins/New_GPG/src/messages.cpp
@@ -187,7 +187,7 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD flags
{ //save inkey id
string::size_type s = out.find(" encrypted with ");
s = out.find(" ID ", s);
- s += strlen(" ID ");
+ s += mir_strlen(" ID ");
string::size_type s2 = out.find(",",s);
db_set_s(db_mc_isMeta(hContact)?metaGetMostOnline(hContact):hContact, szGPGModuleName, "InKeyID", out.substr(s, s2-s).c_str());
}
@@ -420,7 +420,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l)
}
{
char *tmp = NULL;
- string::size_type s = output.find("gpg: key ") + strlen("gpg: key ");
+ string::size_type s = output.find("gpg: key ") + mir_strlen("gpg: key ");
string::size_type s2 = output.find(":", s);
db_set_s(ccs->hContact, szGPGModuleName, "KeyID", output.substr(s,s2-s).c_str());
s2+=2;
diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp
index ee4a83d942..80b49f59c7 100755
--- a/plugins/New_GPG/src/options.cpp
+++ b/plugins/New_GPG/src/options.cpp
@@ -175,7 +175,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
string keyinfo = Translate("Default private key ID");
keyinfo += ": ";
char *keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", "");
- keyinfo += (strlen(keyid) > 0)?keyid:Translate("not set");
+ keyinfo += (mir_strlen(keyid) > 0)?keyid:Translate("not set");
mir_free(keyid);
SetDlgItemTextA(hwndDlg, IDC_CURRENT_KEY, keyinfo.c_str());
}
@@ -507,7 +507,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
string::size_type p1 = out.find("(GnuPG) ");
if(p1 != string::npos)
{
- p1 += strlen("(GnuPG) ");
+ p1 += mir_strlen("(GnuPG) ");
if(out[p1] != '1')
bad_version = true;
}
@@ -527,7 +527,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
char* p_path = NULL;
if(StriStr(atmp, mir_path))
{
- p_path = atmp + strlen(mir_path);
+ p_path = atmp + mir_strlen(mir_path);
tmp = mir_a2t(p_path);
SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp);
}
@@ -545,7 +545,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
char* p_path = NULL;
if(StriStr(atmp, mir_path))
{
- p_path = atmp + strlen(mir_path);
+ p_path = atmp + mir_strlen(mir_path);
tmp = mir_a2t(p_path);
SetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp);
}
@@ -961,7 +961,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
break;
}
char *tmp2;
- string::size_type s = output.find("gpg: key ") + strlen("gpg: key ");
+ 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());
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp
index b4078f24ac..63ece6aab0 100755
--- a/plugins/New_GPG/src/utilities.cpp
+++ b/plugins/New_GPG/src/utilities.cpp
@@ -348,7 +348,7 @@ int onProtoAck(WPARAM w, LPARAM l)
{ // password
TCHAR *pass = NULL;
char *keyid = UniGetContactSettingUtf(ack->hContact, szGPGModuleName, "KeyID", "");
- if(strlen(keyid) > 0)
+ if(mir_strlen(keyid) > 0)
{
string dbsetting = "szKey_";
dbsetting += keyid;
@@ -397,7 +397,7 @@ int onProtoAck(WPARAM w, LPARAM l)
{ //save inkey id
string::size_type s = out.find(" encrypted with ");
s = out.find(" ID ", s);
- s += strlen(" ID ");
+ s += mir_strlen(" ID ");
string::size_type s2 = out.find(",",s);
if(db_mc_isMeta(ack->hContact))
db_set_s(metaGetMostOnline(ack->hContact), szGPGModuleName, "InKeyID", out.substr(s, s2-s).c_str());
@@ -641,7 +641,7 @@ void HistoryLog(MCONTACT hContact, db_event evt)
Event.timestamp = (DWORD)time(NULL);
else
Event.timestamp = evt.timestamp;
- Event.cbBlob = (DWORD)strlen((char*)evt.pBlob)+1;
+ Event.cbBlob = (DWORD)mir_strlen((char*)evt.pBlob)+1;
Event.pBlob = (PBYTE)_strdup((char*)evt.pBlob);
db_event_add(hContact, &Event);
}
@@ -997,7 +997,7 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface *ji, HXML node, voi
if(out.find("key ID ") != string::npos)
{
//need to get hcontact here, i can get jid from hxml, and get handle from jid, maybe exists better way ?
- string::size_type p1 = out.find("key ID ") + strlen("key ID ");
+ string::size_type p1 = out.find("key ID ") + mir_strlen("key ID ");
string::size_type p2 = out.find("\n", p1);
if(p1 != string::npos && p2 != string::npos)
{
@@ -1187,7 +1187,7 @@ bool isGPGValid()
return is_valid && gpg_exists;
}
-#define NEWTSTR_MALLOC(A) (A==NULL)?NULL:strcpy((char*)mir_alloc(sizeof(char)*(strlen(A)+1)),A)
+#define NEWTSTR_MALLOC(A) (A==NULL)?NULL:strcpy((char*)mir_alloc(sizeof(char)*(mir_strlen(A)+1)),A)
const bool StriStr(const char *str, const char *substr)
{
@@ -1195,8 +1195,8 @@ const bool StriStr(const char *str, const char *substr)
char *str_up = NEWTSTR_MALLOC(str);
char *substr_up = NEWTSTR_MALLOC(substr);
- CharUpperBuffA(str_up, (DWORD)strlen(str_up));
- CharUpperBuffA(substr_up, (DWORD)strlen(substr_up));
+ CharUpperBuffA(str_up, (DWORD)mir_strlen(str_up));
+ CharUpperBuffA(substr_up, (DWORD)mir_strlen(substr_up));
if(strstr (str_up, substr_up))
i = true;
@@ -1508,7 +1508,7 @@ void ExportGpGKeysFunc(int type)
std::string::size_type p1 = key.find("-----BEGIN PGP PUBLIC KEY BLOCK-----");
if(p1 == std::string::npos)
continue;
- p1 += strlen("-----BEGIN PGP PUBLIC KEY BLOCK-----");
+ p1 += mir_strlen("-----BEGIN PGP PUBLIC KEY BLOCK-----");
p1 ++;
id += '\n';
key.insert(p1, id);
@@ -1589,10 +1589,10 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
{
std::string::size_type p1 = 0, p2 = 0;
p1 = key.find("Comment: login ");
- p1 += strlen("Comment: login ");
+ p1 += mir_strlen("Comment: login ");
p2 = key.find(" contact_id ");
login = key.substr(p1, p2-p1);
- p2 += strlen(" contact_id ");
+ p2 += mir_strlen(" contact_id ");
p1 = key.find("\n", p2);
contact_id = key.substr(p2, p1-p2);
p1 = key.find("Comment: login ");
@@ -1779,7 +1779,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
break;
}
char *tmp2;
- string::size_type s = output.find("gpg: key ") + strlen("gpg: key ");
+ 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());
diff --git a/plugins/New_GPG/src/utilities.h b/plugins/New_GPG/src/utilities.h
index 32a99ea716..2042864468 100644
--- a/plugins/New_GPG/src/utilities.h
+++ b/plugins/New_GPG/src/utilities.h
@@ -51,12 +51,12 @@ public:
timestamp = time(0);
szModule = 0;
cbSize = 0;
- cbBlob = DWORD(strlen(msg)+1);
+ cbBlob = DWORD(mir_strlen(msg)+1);
pBlob = (PBYTE)msg;
}
db_event(char* msg, DWORD time)
{
- cbBlob = DWORD(strlen(msg)+1);
+ cbBlob = DWORD(mir_strlen(msg)+1);
pBlob = (PBYTE)msg;
eventType = EVENTTYPE_MESSAGE;
flags = 0;
@@ -66,7 +66,7 @@ public:
}
db_event(char* msg, DWORD time, int type)
{
- cbBlob = DWORD(strlen(msg)+1);
+ cbBlob = DWORD(mir_strlen(msg)+1);
pBlob = (PBYTE)msg;
if(type)
eventType = type;
@@ -79,7 +79,7 @@ public:
}
db_event(char* msg, int type)
{
- cbBlob = DWORD(strlen(msg)+1);
+ cbBlob = DWORD(mir_strlen(msg)+1);
pBlob = (PBYTE)msg;
flags = 0;
if(type)
@@ -92,7 +92,7 @@ public:
}
db_event(char* msg, DWORD time, int type, DWORD _flags)
{
- cbBlob = DWORD(strlen(msg)+1);
+ cbBlob = DWORD(mir_strlen(msg)+1);
pBlob = (PBYTE)msg;
if(type)
eventType = type;