From 632700c7828d2b9667c8dc8bc3403f910b51e158 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 13 May 2025 13:16:41 +0300 Subject: fixes #5017 (SendSS: UploadPie not working) + some code formatting --- plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp') diff --git a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp index 4842f16429..a54ffdcb7e 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp @@ -52,7 +52,7 @@ int CSendHost_ImageShack::Send() } m_pRequest.reset(new MHttpRequest(REQUEST_POST)); - char* tmp; tmp = mir_u2a(m_pszFile); + T2Utf tmp(m_pszFile); HTTPFormData frm[] = { // { "Referer", HTTPFORM_HEADER("http://www.imageshack.us/upload_api.php") }, { "fileupload", HTTPFORM_FILE(tmp) }, @@ -60,8 +60,8 @@ int CSendHost_ImageShack::Send() { "public", "no" }, { "key", HTTPFORM_8BIT(DEVKEY_IMAGESHACK) }, }; + int error = HTTPFormCreate(m_pRequest.get(), "http://imageshack.us/upload_api.php", frm, sizeof(frm) / sizeof(HTTPFormData)); - mir_free(tmp); if (error) return !m_bAsync; // start upload thread @@ -79,7 +79,7 @@ void CSendHost_ImageShack::SendThread() NLHR_PTR reply(Netlib_HttpTransaction(g_hNetlibUser, m_pRequest.get())); if (reply) { if (reply->resultCode >= 200 && reply->resultCode < 300 && reply->body.GetLength()) { - const char* url = nullptr; + const char *url = nullptr; url = GetHTMLContent(reply->body.GetBuffer(), "", ""); if (url && *url) { m_URLthumb = m_URL = url; @@ -87,7 +87,7 @@ void CSendHost_ImageShack::SendThread() int idx = m_URLthumb.ReverseFind('.'); if (idx != -1 && m_URLthumb.GetLength() - idx > 2) m_URLthumb.Insert(idx + 1, "th"); - else + else m_URLthumb.Empty(); svcSendMsgExit(url); @@ -95,7 +95,7 @@ void CSendHost_ImageShack::SendThread() } url = GetHTMLContent(reply->body.GetBuffer(), ""); - wchar_t* err = nullptr; + wchar_t *err = nullptr; if (url) err = mir_a2u(url); if (!err || !*err) { // fallback to server response mess mir_free(err); @@ -111,7 +111,7 @@ void CSendHost_ImageShack::SendThread() Exit(ACKRESULT_FAILED); } -void CSendHost_ImageShack::SendThreadWrapper(void * Obj) +void CSendHost_ImageShack::SendThreadWrapper(void *Obj) { - reinterpret_cast(Obj)->SendThread(); + reinterpret_cast(Obj)->SendThread(); } -- cgit v1.2.3