diff options
author | George Hazan <george.hazan@gmail.com> | 2013-09-02 18:14:23 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-09-02 18:14:23 +0000 |
commit | 24b5afcde7cfe2a274cf64008a867189a89c7fea (patch) | |
tree | 8d22d602df8662c86cf469012fb47d0dbd9daa62 /protocols | |
parent | 53b1b8e2ec83e13c5c7f7d87cd0da87313a3c8ec (diff) |
MRA: fix for setting MirVer
git-svn-id: http://svn.miranda-ng.org/main/trunk@5903 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/MRA/src/Mra_functions.cpp | 13 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_proto.cpp | 2 |
2 files changed, 6 insertions, 9 deletions
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index daa6cdb00d..f9daa4b4b0 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -43,19 +43,16 @@ static DWORD GetParamValue(const CMStringA &szData, LPCSTR szParamName, DWORD dw if (szData.IsEmpty())
return ERROR_INVALID_HANDLE;
- char tmp[USER_AGENT_MAX+4096];
- LPSTR lpszParamDataStart, lpszParamDataEnd;
+ char *tmp = NEWSTR_ALLOCA(szData.c_str());
+ _strlwr(tmp);
- DWORD dwDataSize = min(szData.GetLength(), SIZEOF(szData));
- BuffToLowerCase(szData, tmp, dwDataSize);
-
- lpszParamDataStart = strstr(tmp, szParamName);
+ LPSTR lpszParamDataStart = strstr(tmp, szParamName);
if (lpszParamDataStart)
if ((*((WORD*)(lpszParamDataStart+dwParamNameSize))) == (*((WORD*)"=\""))) {
lpszParamDataStart += dwParamNameSize+2;
- lpszParamDataEnd = strchr(lpszParamDataStart, '"');
+ LPSTR lpszParamDataEnd = strchr(lpszParamDataStart, '"');
if (lpszParamDataEnd) {
- szParamValue = CMStringA(szData.c_str()+(lpszParamDataStart-szData), lpszParamDataEnd-lpszParamDataStart);
+ szParamValue = CMStringA(szData.c_str()+(lpszParamDataStart-tmp), lpszParamDataEnd-lpszParamDataStart);
return NO_ERROR;
}
}
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index 3acf1035f2..26f1aceb66 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -1340,7 +1340,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) SetExtraIcons(hContact);
if (dwTemp != ID_STATUS_OFFLINE) { // пишем клиента только если юзер не отключён, иначе не затираем старое
- if (szUserAgentFormatted.GetLength()) {
+ if ( !szUserAgentFormatted.IsEmpty()) {
if (getByte("MirVerRaw", MRA_DEFAULT_MIRVER_RAW) == FALSE)
szUserAgentFormatted = MraGetVersionStringFromFormatted(szUserAgentFormatted);
}
|