diff options
author | George Hazan <george.hazan@gmail.com> | 2013-08-14 19:04:55 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-08-14 19:04:55 +0000 |
commit | b67c40f21c0fe0c80a3ddd31b0b09f71bf5d97d7 (patch) | |
tree | fa22404f4a40f81b86447c5bd7def26fd6815722 /protocols/GTalkExt/src/inbox.cpp | |
parent | c95efb840d744ec332edfe311b69f1c7ac56560a (diff) |
mir_*printf patch for protocols
git-svn-id: http://svn.miranda-ng.org/main/trunk@5690 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/GTalkExt/src/inbox.cpp')
-rw-r--r-- | protocols/GTalkExt/src/inbox.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/protocols/GTalkExt/src/inbox.cpp b/protocols/GTalkExt/src/inbox.cpp index 5608a7794f..471431a185 100644 --- a/protocols/GTalkExt/src/inbox.cpp +++ b/protocols/GTalkExt/src/inbox.cpp @@ -92,8 +92,9 @@ LPSTR HttpPost(HANDLE hUser, LPSTR reqUrl, LPSTR reqParams) LPSTR MakeRequest(HANDLE hUser, LPSTR reqUrl, LPSTR reqParamsFormat, LPSTR p1, LPSTR p2)
{
ptrA encodedP1( mir_urlEncode(p1)), encodedP2( mir_urlEncode(p2));
- LPSTR reqParams = (LPSTR)alloca(lstrlenA(reqParamsFormat) + 1 + lstrlenA(encodedP1) + lstrlenA(encodedP2));
- sprintf(reqParams, reqParamsFormat, encodedP1, encodedP2);
+ size_t size = lstrlenA(reqParamsFormat) + 1 + lstrlenA(encodedP1) + lstrlenA(encodedP2);
+ LPSTR reqParams = (LPSTR)alloca(size);
+ mir_snprintf(reqParams, size, reqParamsFormat, encodedP1, encodedP2);
return HttpPost(hUser, reqUrl, reqParams);
}
@@ -120,8 +121,9 @@ LPSTR FindSid(LPSTR resp, LPSTR *LSID) void DoOpenUrl(LPSTR tokenResp, LPSTR url)
{
ptrA encodedUrl( mir_urlEncode(url)), encodedToken( mir_urlEncode(tokenResp));
- LPSTR composedUrl = (LPSTR)alloca(lstrlenA(TOKEN_AUTH_URL) + 1 + lstrlenA(encodedToken) + lstrlenA(encodedUrl));
- sprintf(composedUrl, TOKEN_AUTH_URL, encodedToken, encodedUrl);
+ size_t size = lstrlenA(TOKEN_AUTH_URL) + 1 + lstrlenA(encodedToken) + lstrlenA(encodedUrl);
+ LPSTR composedUrl = (LPSTR)alloca(size);
+ mir_snprintf(composedUrl, size, TOKEN_AUTH_URL, encodedToken, encodedUrl);
CallService(MS_UTILS_OPENURL, 0, (LPARAM)composedUrl);
}
|