diff options
author | George Hazan <george.hazan@gmail.com> | 2014-11-30 18:51:36 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-11-30 18:51:36 +0000 |
commit | 688f55ba998c19304a29727c910504903f4cc49a (patch) | |
tree | 69121ebb6d02bcf9e670428b11813087fc7f1640 /protocols/Yahoo/src | |
parent | 4f0e30cdf56fbafdf955bbe8b93930bab9e39bd0 (diff) |
lstr* replacements
git-svn-id: http://svn.miranda-ng.org/main/trunk@11176 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Yahoo/src')
-rw-r--r-- | protocols/Yahoo/src/avatar.cpp | 2 | ||||
-rw-r--r-- | protocols/Yahoo/src/file_transfer.cpp | 8 | ||||
-rw-r--r-- | protocols/Yahoo/src/im.cpp | 36 | ||||
-rw-r--r-- | protocols/Yahoo/src/libyahoo2/config.h | 5 | ||||
-rw-r--r-- | protocols/Yahoo/src/libyahoo2/libyahoo2.cpp | 20 | ||||
-rw-r--r-- | protocols/Yahoo/src/proto.cpp | 34 | ||||
-rw-r--r-- | protocols/Yahoo/src/search.cpp | 4 | ||||
-rw-r--r-- | protocols/Yahoo/src/services.cpp | 37 | ||||
-rw-r--r-- | protocols/Yahoo/src/user_info.cpp | 39 | ||||
-rw-r--r-- | protocols/Yahoo/src/util.cpp | 4 | ||||
-rw-r--r-- | protocols/Yahoo/src/yahoo.cpp | 44 |
11 files changed, 108 insertions, 125 deletions
diff --git a/protocols/Yahoo/src/avatar.cpp b/protocols/Yahoo/src/avatar.cpp index 5e2f99ceca..1acdb1fe5f 100644 --- a/protocols/Yahoo/src/avatar.cpp +++ b/protocols/Yahoo/src/avatar.cpp @@ -764,7 +764,7 @@ INT_PTR __cdecl CYahooProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) if (getDword("AvatarHash", 0)) {
if (!getTString("AvatarFile", &dbv)) {
if (_taccess(dbv.ptszVal, 0) == 0) {
- lstrcpyn(buffer, dbv.ptszVal, size-1);
+ mir_tstrncpy(buffer, dbv.ptszVal, size-1);
buffer[size-1] = '\0';
ret = 0;
diff --git a/protocols/Yahoo/src/file_transfer.cpp b/protocols/Yahoo/src/file_transfer.cpp index 9d477785de..1cfe32740f 100644 --- a/protocols/Yahoo/src/file_transfer.cpp +++ b/protocols/Yahoo/src/file_transfer.cpp @@ -486,7 +486,7 @@ void CYahooProto::ext_got_file(const char *me, const char *who, const char *url, ZeroMemory(fn, 1024);
if (fname != NULL)
- lstrcpynA(fn, fname, 1024);
+ mir_strncpy(fn, fname, 1024);
else {
char *start, *end;
@@ -498,9 +498,9 @@ void CYahooProto::ext_got_file(const char *me, const char *who, const char *url, end = ( char* )strrchr(url, '?');
if (start && *start && end) {
- lstrcpynA(fn, start, end-start+1);
+ mir_strncpy(fn, start, end-start+1);
} else
- lstrcpyA(fn, "filename.ext");
+ mir_strcpy(fn, "filename.ext");
}
yahoo_file_info *fi = y_new(struct yahoo_file_info,1);
@@ -557,7 +557,7 @@ void CYahooProto::ext_got_files(const char *me, const char *who, const char *ft_ struct yahoo_file_info *fi = (struct yahoo_file_info *) f->data;
mir_snprintf(z, 1024, "%s (%lu)\r\n", fi->filename, fi->filesize);
- lstrcatA(fn, z);
+ mir_strcat(fn, z);
fc++;
}
diff --git a/protocols/Yahoo/src/im.cpp b/protocols/Yahoo/src/im.cpp index 31e47510ec..03f45a3f37 100644 --- a/protocols/Yahoo/src/im.cpp +++ b/protocols/Yahoo/src/im.cpp @@ -1,9 +1,9 @@ /*
* $Id: im.cpp 12307 2010-08-11 21:49:46Z Michael.Kunz@s2005.TU-Chemnitz.de $
*
- * myYahoo Miranda Plugin
+ * myYahoo Miranda Plugin
*
- * Authors: Gennady Feldman (aka Gena01)
+ * Authors: Gennady Feldman (aka Gena01)
* Laurent Marechal (aka Peorth)
*
* This code is under GPL and is based on AIM, MSN and Miranda source code.
@@ -22,20 +22,20 @@ void CYahooProto::send_msg(const char *id, int protocol, const char *msg, int utf8)
{
LOG(("[send_msg] Who: %s: protocol: %d Msg: '%s', utf: %d", id, protocol, msg, utf8));
-
+
int buddy_icon = (getDword("AvatarHash", 0) != 0) ? 2: 0;
yahoo_send_im(m_id, NULL, id, protocol, msg, utf8, buddy_icon);
}
-void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, const char *msg,
- long tm, int stat, int utf8, int buddy_icon,
+void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, const char *msg,
+ long tm, int stat, int utf8, int buddy_icon,
const char *seqn, int sendn)
{
char *umsg;
const char *c = msg;
int oidx = 0;
- LOG(("YAHOO_GOT_IM id:%s %s: %s (len: %d) tm:%lu stat:%i utf8:%i buddy_icon: %i", me, who, msg, lstrlenA(msg), tm, stat, utf8, buddy_icon));
+ LOG(("YAHOO_GOT_IM id:%s %s: %s (len: %d) tm:%lu stat:%i utf8:%i buddy_icon: %i", me, who, msg, mir_strlen(msg), tm, stat, utf8, buddy_icon));
if (stat == 2) {
char z[1024];
@@ -68,7 +68,7 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons }
// make a bigger buffer for \n -> \r\n conversion (x2)
- umsg = (char *) alloca(lstrlenA(msg) * 2 + 1);
+ umsg = (char *) alloca(mir_strlen(msg) * 2 + 1);
while ( *c != '\0') {
// Strip the font tag
@@ -76,19 +76,19 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons // strip the fade tag
!_strnicmp(c, "<FADE ",6) || !_strnicmp(c,"</FADE>",7) ||
// strip the alternate colors tag
- !_strnicmp(c, "<ALT ",5) || !_strnicmp(c, "</ALT>",6)) {
- while ((*c++ != '>') && (*c != '\0'));
+ !_strnicmp(c, "<ALT ",5) || !_strnicmp(c, "</ALT>",6)) {
+ while ((*c++ != '>') && (*c != '\0'));
} else
// strip ANSI color combination
- if ((*c == 0x1b) && (*(c+1) == '[')) {
- while ((*c++ != 'm') && (*c != '\0'));
+ if ((*c == 0x1b) && (*(c+1) == '[')) {
+ while ((*c++ != 'm') && (*c != '\0'));
} else
if (*c != '\0') {
umsg[oidx++] = *c;
/* Adding \r to \r\n conversion */
- if (*c == '\r' && *(c + 1) != '\n')
+ if (*c == '\r' && *(c + 1) != '\n')
umsg[oidx++] = '\n';
c++;
@@ -115,16 +115,16 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons DBEVENTINFO dbei = { sizeof (dbei) };
dbei.pBlob = (BYTE*)&dummy;
dbei.cbBlob = 2;
- if (!db_event_get(hEvent, &dbei))
+ if (!db_event_get(hEvent, &dbei))
// got that event, if newer than ts then reset to current time
if ((DWORD)tm < dbei.timestamp) tm = (long)time(NULL);
}
pre.timestamp = (DWORD)time(NULL);
-
+
if ((DWORD)tm < pre.timestamp)
pre.timestamp = tm;
-
+
}
else pre.timestamp = (DWORD)time(NULL);
@@ -146,7 +146,7 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons if (buddy_icon != 2)
reset_avatar(hContact);
else if (getDword(hContact, "PictCK", 0) == 0) /* request the buddy image */
- request_avatar(who);
+ request_avatar(who);
}
////////////////////////////////////////////////////////////////////////////////////////
@@ -180,13 +180,13 @@ int __cdecl CYahooProto::SendMsg(MCONTACT hContact, int flags, const char* pszSr ptrA msg;
if (flags & PREF_UNICODE) /* convert to utf8 */
- msg = mir_utf8encodeW((wchar_t*)&pszSrc[strlen(pszSrc) + 1]);
+ msg = mir_utf8encodeW((wchar_t*)&pszSrc[mir_strlen(pszSrc) + 1]);
else if (flags & PREF_UTF)
msg = mir_strdup(pszSrc);
else
msg = mir_utf8encode(pszSrc);
- if (lstrlenA(msg) > 800) {
+ if (mir_strlen(msg) > 800) {
ForkThread(&CYahooProto::im_sendackfail_longmsg, (void*)hContact);
return 1;
}
diff --git a/protocols/Yahoo/src/libyahoo2/config.h b/protocols/Yahoo/src/libyahoo2/config.h index 5de1dbc82d..4b776e5447 100644 --- a/protocols/Yahoo/src/libyahoo2/config.h +++ b/protocols/Yahoo/src/libyahoo2/config.h @@ -25,11 +25,6 @@ #include <windows.h>
#include <stdio.h>
-#define strlen lstrlenA
-#define strcat lstrcatA
-#define strcmp lstrcmpA
-#define strcpy lstrcpyA
-
#ifdef _MSC_VER
#define strncasecmp strnicmp
diff --git a/protocols/Yahoo/src/libyahoo2/libyahoo2.cpp b/protocols/Yahoo/src/libyahoo2/libyahoo2.cpp index aa365d8631..dbad69d900 100644 --- a/protocols/Yahoo/src/libyahoo2/libyahoo2.cpp +++ b/protocols/Yahoo/src/libyahoo2/libyahoo2.cpp @@ -901,34 +901,34 @@ static void yahoo_packet_dump(unsigned char *data, int len) for (i = 0; i < len; i++) { if ((i % 8 == 0) && i) //YAHOO_CALLBACK(ext_yahoo_log)(" "); - lstrcatA(z, " "); + mir_strcat(z, " "); if ((i % 16 == 0) && i) - lstrcatA(z, "\n"); + mir_strcat(z, "\n"); wsprintfA(t, "%02x ", data[i]); - lstrcatA(z, t); + mir_strcat(z, t); } - lstrcatA(z, "\n"); + mir_strcat(z, "\n"); YAHOO_CALLBACK(ext_yahoo_log)(z); z[0]='\0'; for (i = 0; i < len; i++) { if ((i % 8 == 0) && i) //YAHOO_CALLBACK(ext_yahoo_log)(" "); - lstrcatA(z, " "); + mir_strcat(z, " "); if ((i % 16 == 0) && i) //YAHOO_CALLBACK(ext_yahoo_log)("\n"); - lstrcatA(z, "\n"); + mir_strcat(z, "\n"); if (isprint(data[i])) { //YAHOO_CALLBACK(ext_yahoo_log)(" %c ", data[i]); wsprintfA(t, " %c ", data[i]); - lstrcatA(z, t); + mir_strcat(z, t); } else //YAHOO_CALLBACK(ext_yahoo_log)(" . "); - lstrcatA(z, " . "); + mir_strcat(z, " . "); } //YAHOO_CALLBACK(ext_yahoo_log)("\n"); - lstrcatA(z, "\n"); + mir_strcat(z, "\n"); YAHOO_CALLBACK(ext_yahoo_log)(z); } } @@ -1347,7 +1347,7 @@ char *yahoo_decode(const char *t) int i, k; n = y; - end = t + lstrlenA(t); + end = t + mir_strlen(t); for (p = t; p < end; p++, n++) { if (*p == '\\') { diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index d192490718..74d562df93 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -433,8 +433,8 @@ int __cdecl CYahooProto::SetStatus(int iNewStatus) * Load Yahoo ID from the database.
*/
if (!getString(YAHOO_LOGINID, &dbv)) {
- if (lstrlenA(dbv.pszVal) > 0)
- lstrcpynA(m_yahoo_id, dbv.pszVal, 255);
+ if (mir_strlen(dbv.pszVal) > 0)
+ mir_strncpy(m_yahoo_id, dbv.pszVal, 255);
else
err++;
db_free(&dbv);
@@ -445,11 +445,11 @@ int __cdecl CYahooProto::SetStatus(int iNewStatus) }
if (err)
- lstrcpynA(errmsg, Translate("Please enter your Yahoo ID in Options/Network/Yahoo"), 80);
+ mir_strncpy(errmsg, Translate("Please enter your Yahoo ID in Options/Network/Yahoo"), 80);
else {
if (!getString(YAHOO_PASSWORD, &dbv)) {
- if (lstrlenA(dbv.pszVal) > 0)
- lstrcpynA(m_password, dbv.pszVal, 255);
+ if (mir_strlen(dbv.pszVal) > 0)
+ mir_strncpy(m_password, dbv.pszVal, 255);
else
err++;
@@ -461,7 +461,7 @@ int __cdecl CYahooProto::SetStatus(int iNewStatus) }
if (err)
- lstrcpynA(errmsg, Translate("Please enter your Yahoo password in Options/Network/Yahoo"), 80);
+ mir_strncpy(errmsg, Translate("Please enter your Yahoo password in Options/Network/Yahoo"), 80);
}
if (err != 0) {
@@ -477,7 +477,7 @@ int __cdecl CYahooProto::SetStatus(int iNewStatus) FREE(m_pw_token); // No Token yet.
if (!getString(YAHOO_PWTOKEN, &dbv)) {
- if (lstrlenA(dbv.pszVal) > 0)
+ if (mir_strlen(dbv.pszVal) > 0)
m_pw_token = strdup(dbv.pszVal);
db_free(&dbv);
@@ -527,7 +527,7 @@ void __cdecl CYahooProto::get_status_thread(void *param) }
if (!db_get_s(hContact, "CList", "StatusMsg", &dbv)) {
- if (lstrlenA(dbv.pszVal) >= 1)
+ if (mir_strlen(dbv.pszVal) >= 1)
sm = strdup(dbv.pszVal);
db_free(&dbv);
@@ -540,34 +540,34 @@ void __cdecl CYahooProto::get_status_thread(void *param) l = 0;
if (gm)
- l += lstrlenA(gm) + 3;
+ l += mir_strlen(gm) + 3;
- l += lstrlenA(sm) + 1;
+ l += mir_strlen(sm) + 1;
fm = (char *)malloc(l);
fm[0] = '\0';
- if (gm && lstrlenA(gm) > 0) {
+ if (gm && mir_strlen(gm) > 0) {
/* BAH YAHOO SUCKS! WHAT A PAIN!
find first carriage return add status message then add the rest */
char *c = strchr(gm, '\r');
if (c != NULL) {
- lstrcpynA(fm, gm, c - gm + 1);
+ mir_strncpy(fm, gm, c - gm + 1);
fm[c - gm + 1] = '\0';
}
else
- lstrcpyA(fm, gm);
+ mir_strcpy(fm, gm);
if (sm) {
- lstrcatA(fm, ": ");
- lstrcatA(fm, sm);
+ mir_strcat(fm, ": ");
+ mir_strcat(fm, sm);
}
if (c != NULL)
- lstrcatA(fm, c);
+ mir_strcat(fm, c);
}
else if (sm) {
- lstrcatA(fm, sm);
+ mir_strcat(fm, sm);
}
FREE(sm);
diff --git a/protocols/Yahoo/src/search.cpp b/protocols/Yahoo/src/search.cpp index 065539b674..020c9c34b3 100644 --- a/protocols/Yahoo/src/search.cpp +++ b/protocols/Yahoo/src/search.cpp @@ -24,7 +24,7 @@ void __cdecl CYahooProto::search_simplethread(void *snsearch) {
TCHAR *id = (TCHAR *) snsearch;
- if (lstrlen(id) < 4) {
+ if (mir_tstrlen(id) < 4) {
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
MessageBoxA(NULL, "Please enter a valid ID to search for.", "Search", MB_OK);
return;
@@ -167,7 +167,7 @@ void __cdecl CYahooProto::searchadv_thread(void *pHWND) TCHAR searchid[128];
GetDlgItemText(hwndDlg, IDC_SEARCH_ID, searchid, SIZEOF(searchid));
- if (lstrlen(searchid) == 0) {
+ if (mir_tstrlen(searchid) == 0) {
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
MessageBoxA(NULL, "Please enter a valid ID to search for.", "Search", MB_OK);
return;
diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp index f2b179c870..108c893eb1 100644 --- a/protocols/Yahoo/src/services.cpp +++ b/protocols/Yahoo/src/services.cpp @@ -127,7 +127,7 @@ static INT_PTR CALLBACK DlgProcSetCustStat(HWND hwndDlg, UINT msg, WPARAM wParam if ( !ppro->getString(YAHOO_CUSTSTATDB, &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_CUSTSTAT, dbv. pszVal );
- EnableWindow( GetDlgItem(hwndDlg, IDOK ), lstrlenA(dbv.pszVal) > 0);
+ EnableWindow( GetDlgItem(hwndDlg, IDOK ), mir_strlen(dbv.pszVal) > 0);
db_free(&dbv);
}
else {
@@ -366,8 +366,8 @@ INT_PTR __cdecl CYahooProto::GetUnreadEmailCount(WPARAM wParam, LPARAM lParam) void CYahooProto::MenuMainInit( void )
{
char servicefunction[ 100 ];
- lstrcpyA( servicefunction, m_szModuleName);
- char* tDest = servicefunction + lstrlenA( servicefunction );
+ mir_strcpy( servicefunction, m_szModuleName);
+ char* tDest = servicefunction + mir_strlen( servicefunction );
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = servicefunction;
@@ -391,7 +391,7 @@ void CYahooProto::MenuMainInit( void ) mi.hParentMenu = hRoot;
// Show custom status menu
- lstrcpyA( tDest, YAHOO_SET_CUST_STAT );
+ mir_strcpy( tDest, YAHOO_SET_CUST_STAT );
CreateProtoService(YAHOO_SET_CUST_STAT, &CYahooProto::SetCustomStatCommand);
mi.position = 290000;
@@ -401,7 +401,7 @@ void CYahooProto::MenuMainInit( void ) menuItemsAll[0] = Menu_AddProtoMenuItem(&mi);
// Edit My profile
- lstrcpyA( tDest, YAHOO_EDIT_MY_PROFILE );
+ mir_strcpy( tDest, YAHOO_EDIT_MY_PROFILE );
CreateProtoService(YAHOO_EDIT_MY_PROFILE, &CYahooProto::OnEditMyProfile);
mi.position = 290005;
@@ -410,7 +410,7 @@ void CYahooProto::MenuMainInit( void ) menuItemsAll[1] = Menu_AddProtoMenuItem(&mi);
// Show My profile
- lstrcpyA( tDest, YAHOO_SHOW_MY_PROFILE );
+ mir_strcpy( tDest, YAHOO_SHOW_MY_PROFILE );
CreateProtoService(YAHOO_SHOW_MY_PROFILE, &CYahooProto::OnShowMyProfileCommand);
mi.position = 290006;
@@ -419,7 +419,7 @@ void CYahooProto::MenuMainInit( void ) menuItemsAll[2] = Menu_AddProtoMenuItem(&mi);
// Show Yahoo mail
- strcpy( tDest, YAHOO_YAHOO_MAIL );
+ mir_strcpy( tDest, YAHOO_YAHOO_MAIL );
CreateProtoService(YAHOO_YAHOO_MAIL, &CYahooProto::OnGotoMailboxCommand);
mi.position = 290010;
@@ -428,7 +428,7 @@ void CYahooProto::MenuMainInit( void ) menuItemsAll[3] = Menu_AddProtoMenuItem(&mi);
// Show Address Book
- strcpy(tDest, YAHOO_AB);
+ mir_strcpy(tDest, YAHOO_AB);
CreateProtoService(YAHOO_AB, &CYahooProto::OnABCommand);
mi.position = 290015;
@@ -437,45 +437,34 @@ void CYahooProto::MenuMainInit( void ) menuItemsAll[4] = Menu_AddProtoMenuItem(&mi);
// Show Calendar
- strcpy( tDest, YAHOO_CALENDAR );
+ mir_strcpy( tDest, YAHOO_CALENDAR );
CreateProtoService(YAHOO_CALENDAR, &CYahooProto::OnCalendarCommand);
mi.position = 290017;
mi.icolibItem = GetIconHandle( IDI_CALENDAR );
mi.pszName = LPGEN("&Calendar");
menuItemsAll[5] = Menu_AddProtoMenuItem(&mi);
- strcpy( tDest, "/JoinChatRoom");
+ mir_strcpy( tDest, "/JoinChatRoom");
CreateProtoService("/JoinChatRoom", &CYahooProto::CreateConference);
mi.position = 290018;
mi.icolibItem = GetIconHandle(IDI_YAHOO);
mi.pszName = LPGEN("Create Conference");
menuItemsAll[6] = Menu_AddProtoMenuItem(&mi);
-
-
- // Show Refresh
- /*strcpy( tDest, YAHOO_REFRESH );
- CreateProtoService(YAHOO_REFRESH, &CYahooProto::OnRefreshCommand);
-
- mi.position = 500090015;
- mi.icolibItem = GetIconHandle( IDI_REFRESH );
- mi.pszName = LPGEN("&Refresh");
- menuItemsAll[7] = Menu_AddProtoMenuItem(&mi);
- */
}
void CYahooProto::MenuContactInit( void )
{
char servicefunction[ 100 ];
- lstrcpyA( servicefunction, m_szModuleName);
- char* tDest = servicefunction + lstrlenA( servicefunction );
+ mir_strcpy( servicefunction, m_szModuleName);
+ char* tDest = servicefunction + mir_strlen( servicefunction );
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = servicefunction;
mi.pszContactOwner = m_szModuleName;
// Show Profile
- strcpy( tDest, YAHOO_SHOW_PROFILE );
+ mir_strcpy( tDest, YAHOO_SHOW_PROFILE );
CreateProtoService(YAHOO_SHOW_PROFILE, &CYahooProto::OnShowProfileCommand );
mi.position = -2000006000;
diff --git a/protocols/Yahoo/src/user_info.cpp b/protocols/Yahoo/src/user_info.cpp index 85f26616c7..40a035284c 100644 --- a/protocols/Yahoo/src/user_info.cpp +++ b/protocols/Yahoo/src/user_info.cpp @@ -1,9 +1,9 @@ /*
* $Id: proto.cpp 9802 2009-05-18 03:03:48Z gena01 $
*
- * myYahoo Miranda Plugin
+ * myYahoo Miranda Plugin
*
- * Authors: Gennady Feldman (aka Gena01)
+ * Authors: Gennady Feldman (aka Gena01)
* Laurent Marechal (aka Peorth)
*
* This code is under GPL and is based on AIM, MSN and Miranda source code.
@@ -30,7 +30,7 @@ static INT_PTR CALLBACK YahooUserInfoDlgProc( HWND hwndDlg, UINT msg, WPARAM wPa //SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedIcon(SKINICON_OTHER_USERDETAILS));
-
+
break;
case WM_NOTIFY:
@@ -61,39 +61,39 @@ static INT_PTR CALLBACK YahooUserInfoDlgProc( HWND hwndDlg, UINT msg, WPARAM wPa if (hContact) {
DBVARIANT dbv;
char z[128];
-
+
if (ppro->getString( hContact, YAHOO_LOGINID, &dbv) == 0) {
- strcpy(z, dbv.pszVal);
+ mir_strcpy(z, dbv.pszVal);
db_free(&dbv);
} else {
- strcpy(z, "???");
+ mir_strcpy(z, "???");
}
-
+
SetDlgItemTextA(hwndDlg, IDC_SEARCH_ID, z);
-
+
if (ppro->getString( hContact, "Transport", &dbv) == 0) {
- strcpy(z, dbv.pszVal);
+ mir_strcpy(z, dbv.pszVal);
db_free(&dbv);
} else {
- strcpy(z, "Yahoo");
+ mir_strcpy(z, "Yahoo");
}
-
+
SetDlgItemTextA(hwndDlg, IDC_SEARCH_PROTOCOL, z);
-
+
if (ppro->getString( hContact, "MirVer", &dbv) == 0) {
- strcpy(z, dbv.pszVal);
+ mir_strcpy(z, dbv.pszVal);
db_free(&dbv);
} else {
- strcpy(z, "???");
+ mir_strcpy(z, "???");
}
-
+
SetDlgItemTextA(hwndDlg, IDC_NFO_CLIENT, z);
-
+
} else {
}
}
break;
- }
+ }
}
break;
@@ -102,7 +102,7 @@ static INT_PTR CALLBACK YahooUserInfoDlgProc( HWND hwndDlg, UINT msg, WPARAM wPa break;
case WM_DESTROY:
-
+
break;
}
return FALSE;
@@ -125,7 +125,6 @@ int __cdecl CYahooProto::OnUserInfoInit( WPARAM wParam, LPARAM lParam ) odp.pszTemplate = MAKEINTRESOURCEA( IDD_USER_INFO );
odp.ptszTitle = m_tszUserName;
UserInfo_AddPage(wParam, &odp);
- }
+ }
return 0;
}
-
diff --git a/protocols/Yahoo/src/util.cpp b/protocols/Yahoo/src/util.cpp index e806efb274..46e84b09c6 100644 --- a/protocols/Yahoo/src/util.cpp +++ b/protocols/Yahoo/src/util.cpp @@ -111,8 +111,8 @@ int CYahooProto::ShowPopup(const TCHAR* nickname, const TCHAR* msg, const char * POPUPDATAT ppd = { 0 };
ppd.PluginWindowProc = PopupWindowProc;
- lstrcpyn(ppd.lptzContactName, nickname, SIZEOF(ppd.lptzContactName));
- lstrcpyn(ppd.lptzText, msg, SIZEOF(ppd.lptzText));
+ mir_tstrncpy(ppd.lptzContactName, nickname, SIZEOF(ppd.lptzContactName));
+ mir_tstrncpy(ppd.lptzText, msg, SIZEOF(ppd.lptzText));
if (szURL != NULL) {
ppd.lchIcon = LoadIconEx( !lstrcmpiA(szURL, "http://mail.yahoo.com") ? "mail" : "calendar");
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index 7ecf6dc61f..67a150e60a 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -324,7 +324,7 @@ MCONTACT CYahooProto::add_buddy(const char *yahoo_id, const char *yahoo_name, in setString( hContact, YAHOO_LOGINID, yid );
Set_Protocol( hContact, protocol );
- if (lstrlenA(yahoo_name) > 0)
+ if (mir_strlen(yahoo_name) > 0)
SetStringUtf( hContact, "Nick", yahoo_name );
else
SetStringUtf( hContact, "Nick", yahoo_id );
@@ -820,16 +820,16 @@ void CYahooProto::ext_contact_added(const char *myid, const char *who, const cha pre.flags = PREF_UTF;
pre.timestamp = time(NULL);
- pre.lParam = sizeof(DWORD)+sizeof(HANDLE)+lstrlenA(who)+lstrlenA(nick)+5;
+ pre.lParam = sizeof(DWORD)+sizeof(HANDLE)+mir_strlen(who)+mir_strlen(nick)+5;
if (fname != NULL)
- pre.lParam += lstrlenA(fname);
+ pre.lParam += mir_strlen(fname);
if (lname != NULL)
- pre.lParam += lstrlenA(lname);
+ pre.lParam += mir_strlen(lname);
if (msg != NULL)
- pre.lParam += lstrlenA(msg);
+ pre.lParam += mir_strlen(msg);
pCurBlob = (PBYTE)malloc(pre.lParam);
pre.szMessage = (char *)pCurBlob;
@@ -843,24 +843,24 @@ void CYahooProto::ext_contact_added(const char *myid, const char *who, const cha pCurBlob += sizeof(DWORD);
// NICK
- lstrcpyA((char*)pCurBlob, nick);
+ mir_strcpy((char*)pCurBlob, nick);
- pCurBlob+=lstrlenA((char *)pCurBlob)+1;
+ pCurBlob+=mir_strlen((char *)pCurBlob)+1;
// FIRST
- lstrcpyA((char*)pCurBlob, (fname != NULL) ? fname : "");
- pCurBlob+=lstrlenA((char *)pCurBlob)+1;
+ mir_strcpy((char*)pCurBlob, (fname != NULL) ? fname : "");
+ pCurBlob+=mir_strlen((char *)pCurBlob)+1;
// LAST
- lstrcpyA((char*)pCurBlob, (lname != NULL) ? lname : "");
- pCurBlob+=lstrlenA((char *)pCurBlob)+1;
+ mir_strcpy((char*)pCurBlob, (lname != NULL) ? lname : "");
+ pCurBlob+=mir_strlen((char *)pCurBlob)+1;
// E-mail
- lstrcpyA((char*)pCurBlob,who);
- pCurBlob+=lstrlenA((char *)pCurBlob)+1;
+ mir_strcpy((char*)pCurBlob,who);
+ pCurBlob+=mir_strlen((char *)pCurBlob)+1;
// Reason
- lstrcpyA((char*)pCurBlob, (msg != NULL) ? msg : "");
+ mir_strcpy((char*)pCurBlob, (msg != NULL) ? msg : "");
ProtoChainRecv(hContact, PSR_AUTH, 0, (LPARAM)&pre);
}
@@ -929,7 +929,7 @@ void CYahooProto::ext_game_notify(const char *me, const char *who, int stat, con * [17:18:38 YAHOO] [ext_yahoo_game_notify] id: 1, me: xxxxx, who: rrrrr,
* stat: 2, msg: 1 ygamesa 2
*/
- z = (char *) _alloca(lstrlenA(l) + 50);
+ z = (char *) _alloca(mir_strlen(l) + 50);
z[0]='\0';
do{
@@ -950,16 +950,16 @@ void CYahooProto::ext_game_notify(const char *me, const char *who, int stat, con if (c != NULL) {
(*c) = '\0';
- lstrcatA(z, l);
- lstrcatA(z, "\r\n");
+ mir_strcat(z, l);
+ mir_strcat(z, "\r\n");
l = c + 1;
} else {
- lstrcatA(z, l);
+ mir_strcat(z, l);
}
} while (c != NULL);
- lstrcatA(z, "\r\n\r\nhttp://games.yahoo.com/games/");
- lstrcatA(z, u);
+ mir_strcat(z, "\r\n\r\nhttp://games.yahoo.com/games/");
+ mir_strcat(z, u);
c = strchr(z, 0x09);
(*c) = '\0';
}
@@ -1557,8 +1557,8 @@ void CYahooProto::ext_login(enum yahoo_status login_mode) }
}
- lstrcpynA(fthost,getByte("YahooJapan",0)?"filetransfer.msg.yahoo.co.jp":"filetransfer.msg.yahoo.com" , sizeof(fthost));
- lstrcpynA(login_host,getByte("YahooJapan",0)?"login.yahoo.co.jp":"login.yahoo.com" , sizeof(login_host));
+ mir_strncpy(fthost,getByte("YahooJapan",0)?"filetransfer.msg.yahoo.co.jp":"filetransfer.msg.yahoo.com" , sizeof(fthost));
+ mir_strncpy(login_host,getByte("YahooJapan",0)?"login.yahoo.co.jp":"login.yahoo.com" , sizeof(login_host));
port = getWord(NULL, YAHOO_LOGINPORT, YAHOO_DEFAULT_PORT);
#ifdef HTTP_GATEWAY
|