summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/chat/log.cpp2
-rw-r--r--src/modules/chat/tools.cpp4
-rw-r--r--src/modules/clist/clistmod.cpp2
-rw-r--r--src/modules/fonts/FontOptions.cpp4
-rw-r--r--src/modules/fonts/services.cpp6
-rw-r--r--src/modules/netlib/netlibautoproxy.cpp2
-rw-r--r--src/modules/skin/sounds.cpp2
-rw-r--r--src/modules/utils/bmpfilter.cpp2
-rw-r--r--src/modules/xml/xmlParser.cpp4
9 files changed, 15 insertions, 13 deletions
diff --git a/src/modules/chat/log.cpp b/src/modules/chat/log.cpp
index 153e01e7cd..d2ebaefbe9 100644
--- a/src/modules/chat/log.cpp
+++ b/src/modules/chat/log.cpp
@@ -235,7 +235,7 @@ static void AddEventToBuffer(char **buffer, int *bufferEnd, int *bufferAlloced,
if (streamData->lin->ptszUserInfo)
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s (%s)"), szTemp2, streamData->lin->ptszUserInfo);
else
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s"), szTemp2);
+ _tcsncpy_s(szTemp, szTemp2, _TRUNCATE);
pszNick = szTemp;
}
diff --git a/src/modules/chat/tools.cpp b/src/modules/chat/tools.cpp
index aabd4535fb..ee64919f10 100644
--- a/src/modules/chat/tools.cpp
+++ b/src/modules/chat/tools.cpp
@@ -489,7 +489,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
if (gce->ptszUserInfo)
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s (%s)"), szTemp2, gce->ptszUserInfo);
else
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s"), szTemp2);
+ _tcsncpy_s(szTemp, szTemp2, _TRUNCATE);
pszNick = szTemp;
}
@@ -546,7 +546,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
break;
case GC_EVENT_INFORMATION:
p = '!';
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), _T("%s"), ci.RemoveFormatting(gce->ptszText));
+ _tcsncpy_s(szBuffer, ci.RemoveFormatting(gce->ptszText), _TRUNCATE);
break;
case GC_EVENT_ADDSTATUS:
p = '+';
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp
index fc6c717519..df89fd1a23 100644
--- a/src/modules/clist/clistmod.cpp
+++ b/src/modules/clist/clistmod.cpp
@@ -119,7 +119,7 @@ static INT_PTR GetStatusModeDescription(WPARAM wParam, LPARAM lParam)
if (!(lParam & GSMDF_TCHAR)) {
static char szMode[64];
char *buf2 = mir_u2a(buf1);
- mir_snprintf(szMode, SIZEOF(szMode), "%s", buf2);
+ strncpy_s(szMode, buf2, _TRUNCATE);
mir_free(buf2);
return (INT_PTR)szMode;
}
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp
index 97598e7674..3091965994 100644
--- a/src/modules/fonts/FontOptions.cpp
+++ b/src/modules/fonts/FontOptions.cpp
@@ -522,7 +522,7 @@ static void sttSaveFontData(HWND hwndDlg, FontInternal &F)
if (F.flags & FIDF_APPENDNAME)
mir_snprintf(str, SIZEOF(str), "%sName", F.prefix);
else
- mir_snprintf(str, SIZEOF(str), "%s", F.prefix);
+ strncpy_s(str, F.prefix, _TRUNCATE);
if (db_set_ts(NULL, F.dbSettingsGroup, str, F.value.szFace)) {
char buff[1024];
@@ -1185,7 +1185,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
for (i=0; i < colour_id_list_w2.getCount(); i++) {
ColourInternal& C = colour_id_list_w2[i];
- mir_snprintf(str, SIZEOF(str), "%s", C.setting);
+ strncpy_s(str, C.setting, _TRUNCATE);
db_set_dw(NULL, C.dbSettingsGroup, str, C.value);
}
diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp
index 1c7b0783dd..63ab76242c 100644
--- a/src/modules/fonts/services.cpp
+++ b/src/modules/fonts/services.cpp
@@ -142,8 +142,10 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT* lf, COLORR
GetDefaultFontSetting(lf, colour);
- if (flags & FIDF_APPENDNAME) mir_snprintf(idstr, SIZEOF(idstr), "%sName", prefix);
- else mir_snprintf(idstr, SIZEOF(idstr), "%s", prefix);
+ if (flags & FIDF_APPENDNAME)
+ mir_snprintf(idstr, SIZEOF(idstr), "%sName", prefix);
+ else
+ strncpy_s(idstr, prefix, _TRUNCATE);
if (!db_get_ts(NULL, settings_group, idstr, &dbv)) {
_tcscpy(lf->lfFaceName, dbv.ptszVal);
diff --git a/src/modules/netlib/netlibautoproxy.cpp b/src/modules/netlib/netlibautoproxy.cpp
index 5f3c1280de..356c25fc8c 100644
--- a/src/modules/netlib/netlibautoproxy.cpp
+++ b/src/modules/netlib/netlibautoproxy.cpp
@@ -176,7 +176,7 @@ bool NetlibGetIeProxyConn(NetlibConnection *nlc, bool forceHttps)
mir_snprintf(szUrl, SIZEOF(szUrl), "http://%s", nlc->nloc.szHost);
else
{
- mir_snprintf(szUrl, SIZEOF(szUrl), "%s", nlc->nloc.szHost);
+ strncpy_s(szUrl, nlc->nloc.szHost, _TRUNCATE);
noHttp = true;
}
diff --git a/src/modules/skin/sounds.cpp b/src/modules/skin/sounds.cpp
index 64a257620e..67a92df35a 100644
--- a/src/modules/skin/sounds.cpp
+++ b/src/modules/skin/sounds.cpp
@@ -298,7 +298,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
db_free(&dbv);
} } }
- mir_sntprintf(strFull, SIZEOF(strFull), _T("%s"), snd.ptszTempFile ? snd.ptszTempFile : _T(""));
+ _tcsncpy_s(strFull, (snd.ptszTempFile ? snd.ptszTempFile : _T("")), _TRUNCATE);
PathToAbsoluteT(strFull, strdir);
OPENFILENAME ofn;
diff --git a/src/modules/utils/bmpfilter.cpp b/src/modules/utils/bmpfilter.cpp
index 9e7c28caba..16b3963ab8 100644
--- a/src/modules/utils/bmpfilter.cpp
+++ b/src/modules/utils/bmpfilter.cpp
@@ -39,7 +39,7 @@ static INT_PTR sttBitmapLoader(const TCHAR* ptszFileName)
TCHAR szFilename[MAX_PATH];
if (!PathToAbsoluteT(ptszFileName, szFilename))
- mir_sntprintf(szFilename, SIZEOF(szFilename), _T("%s"), ptszFileName);
+ _tcsncpy_s(szFilename, ptszFileName, _TRUNCATE);
size_t filenameLen = mir_tstrlen(szFilename);
if (filenameLen > 4) {
diff --git a/src/modules/xml/xmlParser.cpp b/src/modules/xml/xmlParser.cpp
index 04c82c59d3..21cf0a0548 100644
--- a/src/modules/xml/xmlParser.cpp
+++ b/src/modules/xml/xmlParser.cpp
@@ -202,7 +202,7 @@ wchar_t *myMultiByteToWideChar(const char *s, XMLNode::XMLCharEncoding ce)
return d;
}
static inline FILE *xfopen(XMLCSTR filename, XMLCSTR mode) { return _wfopen(filename, mode); }
-static inline int xstrlen(XMLCSTR c) { return (int)wcslen(c); }
+static inline size_t xstrlen(XMLCSTR c) { return wcslen(c); }
static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return _wcsnicmp(c1, c2, l);}
static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return wcsncmp(c1, c2, l);}
static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return _wcsicmp(c1, c2); }
@@ -236,7 +236,7 @@ char *myWideCharToMultiByte(const wchar_t *s)
return d;
}
static inline FILE *xfopen(XMLCSTR filename, XMLCSTR mode) { return fopen(filename, mode); }
-static inline int xstrlen(XMLCSTR c) { return (int)strlen(c); }
+static inline size_t xstrlen(XMLCSTR c) { return strlen(c); }
#ifdef __BORLANDC__
static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return strnicmp(c1, c2, l);}
static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return stricmp(c1, c2); }