From 114f83d5d8a73b3f1435e09b1d91aff843e4ce15 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Tue, 2 Dec 2014 05:19:23 +0000 Subject: mir_snprintf(..., "%s", ...) -> strncpy_s(...) build fix to prevous commit git-svn-id: http://svn.miranda-ng.org/main/trunk@11212 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Yahoo/src/yahoo.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'protocols/Yahoo/src/yahoo.cpp') diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index 44e313320e..eb920fe9ba 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -794,12 +794,12 @@ void CYahooProto::ext_contact_added(const char *myid, const char *who, const cha if (lname && fname) mir_snprintf(nick, SIZEOF(nick), "%s %s", fname, lname); else if (lname) - mir_snprintf(nick, SIZEOF(nick), "%s", lname); + strncpy_s(nick, lname, _TRUNCATE); else if (fname) - mir_snprintf(nick, SIZEOF(nick), "%s", fname); + strncpy_s(nick, fname, _TRUNCATE); - if (nick[0] == '\0') - mir_snprintf(nick, SIZEOF(nick), "%s", who); + if (nick[0] == '\0') + strncpy_s(nick, who, _TRUNCATE); if (fname) SetStringUtf(hContact, "FirstName", fname); if (lname) SetStringUtf(hContact, "LastName", lname); @@ -1546,14 +1546,10 @@ void CYahooProto::ext_login(enum yahoo_status login_mode) if (host[0] == '\0') { if (!getString(YAHOO_LOGINSERVER, &dbv)) { - mir_snprintf(host, SIZEOF(host), "%s", dbv.pszVal); + strncpy_s(host, dbv.pszVal, _TRUNCATE); db_free(&dbv); - } - else { - mir_snprintf(host, SIZEOF(host), "%s", - getByte("YahooJapan",0) != 0 ? YAHOO_DEFAULT_JAPAN_LOGIN_SERVER : - YAHOO_DEFAULT_LOGIN_SERVER - ); + } else { + strncpy_s(host, (getByte("YahooJapan",0) ? YAHOO_DEFAULT_JAPAN_LOGIN_SERVER : YAHOO_DEFAULT_LOGIN_SERVER), _TRUNCATE); } } -- cgit v1.2.3