summaryrefslogtreecommitdiff
path: root/plugins/MirOTR
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/MirOTR
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/MirOTR')
-rw-r--r--plugins/MirOTR/src/dbfilter.cpp10
-rw-r--r--plugins/MirOTR/src/dialogs.cpp8
-rw-r--r--plugins/MirOTR/src/entities.cpp8
-rw-r--r--plugins/MirOTR/src/entities.h2
-rw-r--r--plugins/MirOTR/src/striphtml.cpp2
-rw-r--r--plugins/MirOTR/src/svcs_proto.cpp2
6 files changed, 16 insertions, 16 deletions
diff --git a/plugins/MirOTR/src/dbfilter.cpp b/plugins/MirOTR/src/dbfilter.cpp
index efc6b04ef0..676de8c404 100644
--- a/plugins/MirOTR/src/dbfilter.cpp
+++ b/plugins/MirOTR/src/dbfilter.cpp
@@ -77,7 +77,7 @@ int OnDatabaseEventPreAdd(WPARAM hContact, LPARAM lParam)
char *msg = (char *)dbei->pBlob;
char *newmsg = 0;
DWORD alloclen = 0;
- DWORD msglen = (DWORD)strlen(msg);
+ DWORD msglen = (DWORD)mir_strlen(msg);
if (dbei->flags & DBEF_UTF) {
int prefixlen = (int)strnlen(options.prefix, 64);
if (strncmp(msg, options.prefix, prefixlen) == 0) return 0;
@@ -119,7 +119,7 @@ int OnDatabaseEventPreAdd(WPARAM hContact, LPARAM lParam)
int msglenw = (int)wcslen(msgw);
char *prefix = mir_utf8decodeA(options.prefix);
- int prefixlen = (int)strlen(prefix);
+ int prefixlen = (int)mir_strlen(prefix);
alloclen = (msglen+prefixlen+1)* sizeof(char) + (msglenw + prefixlenw +1) * sizeof(wchar_t);
// get additional data
@@ -144,7 +144,7 @@ int OnDatabaseEventPreAdd(WPARAM hContact, LPARAM lParam)
}
else {
char *prefix = mir_utf8decodeA(options.prefix);
- int prefixlen = (int)strlen(prefix);
+ int prefixlen = (int)mir_strlen(prefix);
if (strncmp(msg, prefix, prefixlen) == 0) {
mir_free(prefix);
return 0;
@@ -186,8 +186,8 @@ int OnDatabaseEventPreAdd(WPARAM hContact, LPARAM lParam)
static char* prefixutf = mir_utf8encodeT(TranslateT(LANG_INLINE_PREFIX));
static char* prefix = Translate(LANG_INLINE_PREFIX);
- static DWORD lenutf = (DWORD)strlen(prefixutf);
- static DWORD len = (DWORD)strlen(prefix);
+ static DWORD lenutf = (DWORD)mir_strlen(prefixutf);
+ static DWORD len = (DWORD)mir_strlen(prefix);
DBEVENTINFO info = { sizeof(info) };
info.cbBlob = lenutf*2;
diff --git a/plugins/MirOTR/src/dialogs.cpp b/plugins/MirOTR/src/dialogs.cpp
index c4ad4b9f63..f724c5a371 100644
--- a/plugins/MirOTR/src/dialogs.cpp
+++ b/plugins/MirOTR/src/dialogs.cpp
@@ -280,7 +280,7 @@ INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
char *ans = mir_utf8encodeT(answer);
delete[] answer;
- otr_continue_smp(context, (const unsigned char *)ans, strlen(ans));
+ otr_continue_smp(context, (const unsigned char *)ans, mir_strlen(ans));
mir_free(ans);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, NULL);
DestroyWindow(hwndDlg);
@@ -439,7 +439,7 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
delete answer;
SMPInitUpdateDialog(context, false);
- otr_start_smp(context, quest, (const unsigned char*)ans, strlen(ans));
+ otr_start_smp(context, quest, (const unsigned char*)ans, mir_strlen(ans));
mir_free(quest);
mir_free(ans);
}
@@ -457,7 +457,7 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
delete[] answer;
SMPInitUpdateDialog(context, false);
- otr_start_smp(context, NULL, (const unsigned char*)ans, strlen(ans));
+ otr_start_smp(context, NULL, (const unsigned char*)ans, mir_strlen(ans));
mir_free(ans);
}
@@ -613,7 +613,7 @@ void SMPDialogReply(ConnContext *context, const char* question){
ShowError(_T("SMP requires user password (NOT IMPL YET)"));
otr_abort_smp(context);
*/
- //otr_continue_smp(context, pass, strlen(pass));
+ //otr_continue_smp(context, pass, mir_strlen(pass));
}
unsigned int CALLBACK verify_context_thread(void *param);
diff --git a/plugins/MirOTR/src/entities.cpp b/plugins/MirOTR/src/entities.cpp
index 084c05b2d0..87cc198eaa 100644
--- a/plugins/MirOTR/src/entities.cpp
+++ b/plugins/MirOTR/src/entities.cpp
@@ -268,7 +268,7 @@ static const char *named_entities[][2] =
static int cmp(const void *key, const void *element)
{
return strncmp((const char *)key, *(const char **)element,
- strlen(*(const char **)element));
+ mir_strlen(*(const char **)element));
}
static const char *get_named_entity(const char *name)
@@ -346,7 +346,7 @@ static _Bool parse_entity(const char *current, char **to,
const char *entity = get_named_entity(&current[1]);
if(entity)
{
- size_t len = strlen(entity);
+ size_t len = mir_strlen(entity);
memcpy(*to, entity, len);
*to += len;
@@ -367,7 +367,7 @@ size_t decode_html_entities_utf8(char *dest, const char *src, size_t len)
const char *from = src;
const char *current;
- if (!len) len = strlen(src);
+ if (!len) len = mir_strlen(src);
size_t remain = len;
while((current = (const char*)memchr(from, '&', len-(from-src))))
{
@@ -417,7 +417,7 @@ char * encode_html_entities_utf8(const char *src) {
}
pos = strpbrk(start, "&<>\"\r");
}
- if (strlen(start)) buf.append(start);
+ if (mir_strlen(start)) buf.append(start);
pos = mir_strdup(buf.c_str());
buf.clear();
return (char*)pos;
diff --git a/plugins/MirOTR/src/entities.h b/plugins/MirOTR/src/entities.h
index 0d3cc1b822..a29f21ef22 100644
--- a/plugins/MirOTR/src/entities.h
+++ b/plugins/MirOTR/src/entities.h
@@ -11,7 +11,7 @@ extern size_t decode_html_entities_utf8(char *dest, const char *src, size_t len)
the entities in-place
otherwise, the output will be placed in `dest`, which should point
- to a buffer big enough to hold `strlen(src) + 1` characters, while
+ to a buffer big enough to hold `mir_strlen(src) + 1` characters, while
`src` remains unchanged
if `len` is given, `dest` must be at least big enough
to hold `len + 1` characters.
diff --git a/plugins/MirOTR/src/striphtml.cpp b/plugins/MirOTR/src/striphtml.cpp
index 4a3c3759ff..a7d84b69c4 100644
--- a/plugins/MirOTR/src/striphtml.cpp
+++ b/plugins/MirOTR/src/striphtml.cpp
@@ -94,7 +94,7 @@ char * striphtml(char *html) {
STRIPHTML_DATA data;
ekhtml_string_t ekstring;
- ekstring.len = strlen(html);
+ ekstring.len = mir_strlen(html);
ekstring.str = html;
data.buffer.clear();
diff --git a/plugins/MirOTR/src/svcs_proto.cpp b/plugins/MirOTR/src/svcs_proto.cpp
index 22b428145e..dcce57fc22 100644
--- a/plugins/MirOTR/src/svcs_proto.cpp
+++ b/plugins/MirOTR/src/svcs_proto.cpp
@@ -137,7 +137,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam)
msg_free = mir_free;
}
if (options.prefix_messages) {
- size_t len = (strlen(options.prefix)+strlen(newmessage)+1)*sizeof(char);
+ size_t len = (mir_strlen(options.prefix)+mir_strlen(newmessage)+1)*sizeof(char);
char* tmp = (char*)mir_alloc( len );
strcpy(tmp, options.prefix);
strcat(tmp, newmessage);