diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-02 03:47:27 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-02 03:47:27 +0000 |
commit | 6e2b6b31bae6d69bff5271451e73eb08637b8118 (patch) | |
tree | ca636f1497e4cc6980736d56a7ff61e3a6f88079 /src/modules/fonts | |
parent | d83beb598f0944dcb944524b1d27525dc320cf18 (diff) |
mir_sntprintf(..., _T("%s"), ...) -> _tcsncpy_s(..., ..., _TRUNCATE)
fix some x64 ptr truncations
git-svn-id: http://svn.miranda-ng.org/main/trunk@11211 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/fonts')
-rw-r--r-- | src/modules/fonts/FontOptions.cpp | 4 | ||||
-rw-r--r-- | src/modules/fonts/services.cpp | 6 |
2 files changed, 6 insertions, 4 deletions
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);
|