From 688f55ba998c19304a29727c910504903f4cc49a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 30 Nov 2014 18:51:36 +0000 Subject: lstr* replacements git-svn-id: http://svn.miranda-ng.org/main/trunk@11176 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/GmailNotifier/src/check.cpp | 70 ++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'plugins/GmailNotifier/src/check.cpp') diff --git a/plugins/GmailNotifier/src/check.cpp b/plugins/GmailNotifier/src/check.cpp index b3821cb7cf..6e407a1afd 100644 --- a/plugins/GmailNotifier/src/check.cpp +++ b/plugins/GmailNotifier/src/check.cpp @@ -23,23 +23,23 @@ void CheckMailInbox(Account *curAcc) curAcc->IsChecking = TRUE; if (!db_get_s(curAcc->hContact, "CList", "MyHandle", &dbv)) { - lstrcpyA(curAcc->results.content, dbv.pszVal); + mir_strcpy(curAcc->results.content, dbv.pszVal); db_free(&dbv); } - else lstrcpyA(curAcc->results.content, curAcc->name); + else mir_strcpy(curAcc->results.content, curAcc->name); tail = strstr(curAcc->results.content, " ["); if (tail) *tail = '\0'; - lstrcatA(curAcc->results.content, " ["); + mir_strcat(curAcc->results.content, " ["); - lstrcpyA(str, curAcc->results.content); - lstrcatA(str, Translate("Checking...")); - lstrcatA(str, "]"); + mir_strcpy(str, curAcc->results.content); + mir_strcat(str, Translate("Checking...")); + mir_strcat(str, "]"); db_set_s(curAcc->hContact, "CList", "MyHandle", str); hHTTPOpen = InternetOpenA("", INTERNET_OPEN_TYPE_PRECONFIG, "", "", 0); if (!hHTTPOpen) { - lstrcatA(curAcc->results.content, Translate("Can't open Internet!")); + mir_strcat(curAcc->results.content, Translate("Can't open Internet!")); goto error_handle; } @@ -54,22 +54,22 @@ void CheckMailInbox(Account *curAcc) 0); if (!hHTTPConnection) { - lstrcatA(curAcc->results.content, Translate("Can't reach server!")); + mir_strcat(curAcc->results.content, Translate("Can't reach server!")); goto error_handle; } - lstrcpyA(str, "/a/"); - lstrcatA(str, curAcc->hosted); - lstrcatA(str, "/LoginAction"); + mir_strcpy(str, "/a/"); + mir_strcat(str, curAcc->hosted); + mir_strcat(str, "/LoginAction"); hHTTPRequest = HttpOpenRequestA(hHTTPConnection, "POST", str, HTTP_VERSIONA, NULL, NULL, INTERNET_FLAG_SECURE, 0); - lstrcatA(requestBuffer, curAcc->hosted); - lstrcatA(requestBuffer, "%2Ffeed%2Fatom&service=mail&userName="); - lstrcatA(requestBuffer, curAcc->name); + mir_strcat(requestBuffer, curAcc->hosted); + mir_strcat(requestBuffer, "%2Ffeed%2Fatom&service=mail&userName="); + mir_strcat(requestBuffer, curAcc->name); tail = strchr(requestBuffer, '@'); *tail = '\0'; - lstrcatA(requestBuffer, "&password="); - lstrcatA(requestBuffer, curAcc->pass); + mir_strcat(requestBuffer, "&password="); + mir_strcat(requestBuffer, curAcc->pass); if (!HttpSendRequestA(hHTTPRequest, contentType, (int)strlen(contentType) + 1, requestBuffer, (int)strlen(requestBuffer) + 1)) { - lstrcpyA(curAcc->results.content, Translate("Can't send account data!")); + mir_strcpy(curAcc->results.content, Translate("Can't send account data!")); goto error_handle; } @@ -79,40 +79,40 @@ void CheckMailInbox(Account *curAcc) hHTTPConnection = InternetConnectA(hHTTPOpen, "mail.google.com", INTERNET_DEFAULT_HTTPS_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); if (!hHTTPConnection) { - lstrcatA(curAcc->results.content, Translate("Can't reach server!")); + mir_strcat(curAcc->results.content, Translate("Can't reach server!")); goto error_handle; } if (curAcc->hosted[0]) { - lstrcpyA(str, "/a/"); - lstrcatA(str, curAcc->hosted); - lstrcatA(str, "/feed/atom"); + mir_strcpy(str, "/a/"); + mir_strcat(str, curAcc->hosted); + mir_strcat(str, "/feed/atom"); } - else lstrcpyA(str, "/mail/feed/atom"); + else mir_strcpy(str, "/mail/feed/atom"); hHTTPRequest = HttpOpenRequest(hHTTPConnection, _T("GET"), _A2T(str), NULL, NULL, NULL, INTERNET_FLAG_SECURE | INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_RELOAD, 0); InternetSetOption(hHTTPRequest, INTERNET_OPTION_USERNAME, _A2T(curAcc->name), (int)strlen(curAcc->name) + 1); InternetSetOption(hHTTPRequest, INTERNET_OPTION_PASSWORD, _A2T(curAcc->pass), (int)strlen(curAcc->pass) + 1); if (!HttpSendRequest(hHTTPRequest, NULL, 0, NULL, 0)) { - lstrcatA(curAcc->results.content, Translate("Can't get RSS feed!")); + mir_strcat(curAcc->results.content, Translate("Can't get RSS feed!")); goto error_handle; } while (InternetReadFile(hHTTPRequest, temp, _MAX_DOWN_BUFFER, &bufferLength) && bufferLength > 0) { temp[bufferLength] = '\0'; - lstrcatA(fileBuffer, temp); + mir_strcat(fileBuffer, temp); } fileBuffer[_MAX_DOWN_BUFFER - 1] = '\0'; curAcc->results_num = ParsePage(fileBuffer, &curAcc->results); if (curAcc->results_num == -1) { - lstrcatA(curAcc->results.content, Translate("Wrong name or password!")); + mir_strcat(curAcc->results.content, Translate("Wrong name or password!")); goto error_handle; } InternetCloseHandle(hHTTPOpen); InternetCloseHandle(hHTTPConnection); InternetCloseHandle(hHTTPRequest); - lstrcatA(curAcc->results.content, _itoa(curAcc->results_num, str, 10)); - lstrcatA(curAcc->results.content, "]"); + mir_strcat(curAcc->results.content, _itoa(curAcc->results_num, str, 10)); + mir_strcat(curAcc->results.content, "]"); curAcc->IsChecking = FALSE; return; @@ -123,7 +123,7 @@ error_handle: InternetCloseHandle(hHTTPConnection); InternetCloseHandle(hHTTPRequest); - lstrcatA(curAcc->results.content, "]"); + mir_strcat(curAcc->results.content, "]"); curAcc->IsChecking = FALSE; } @@ -162,20 +162,20 @@ int ParsePage(char *page, resultLink *prst) str_head += 7; str_tail = strstr(str_head, ""); *str_tail = '\0'; - lstrcpynA(title, str_head, 41); - if (lstrlenA(title) == 40) - lstrcatA(title, "..."); + mir_strncpy(title, str_head, 41); + if (mir_strlen(title) == 40) + mir_strcat(title, "..."); *str_tail = ' '; str_head = strstr(str_head, "") + 6; str_tail = strstr(str_head, ""); *str_tail = '\0'; - lstrcpynA(name, str_head, 11); - lstrcatA(name, ": "); + mir_strncpy(name, str_head, 11); + mir_strcat(name, ": "); *str_tail = ' '; - lstrcpyA(prst->content, name); - lstrcatA(prst->content, title); + mir_strcpy(prst->content, name); + mir_strcat(prst->content, title); MultiByteToWideChar(CP_UTF8, 0, prst->content, -1, str, 64); WideCharToMultiByte(CP_ACP, 0, str, -1, prst->content, 64, NULL, NULL); num++; -- cgit v1.2.3