summaryrefslogtreecommitdiff
path: root/protocols/MRA/src/Mra_functions.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-09-02 18:14:23 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-09-02 18:14:23 +0000
commit24b5afcde7cfe2a274cf64008a867189a89c7fea (patch)
tree8d22d602df8662c86cf469012fb47d0dbd9daa62 /protocols/MRA/src/Mra_functions.cpp
parent53b1b8e2ec83e13c5c7f7d87cd0da87313a3c8ec (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/MRA/src/Mra_functions.cpp')
-rw-r--r--protocols/MRA/src/Mra_functions.cpp13
1 files changed, 5 insertions, 8 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;
}
}