diff options
author | René Schümann <white06tiger@gmail.com> | 2015-03-26 20:42:04 +0000 |
---|---|---|
committer | René Schümann <white06tiger@gmail.com> | 2015-03-26 20:42:04 +0000 |
commit | e3dac6207e1bc1c0194e236a058a5eef12627d2c (patch) | |
tree | 2d3cf5af79a301f5511cb72c537daf430779577d /plugins/MirOTR/src/options.cpp | |
parent | b2f75299d07e7dd789c62584e034aba712e21735 (diff) |
MirOTR: cleaned-up our OTR messages and other string stuff (such as using mir_strncpy instead of unsafe strncpy)
git-svn-id: http://svn.miranda-ng.org/main/trunk@12512 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR/src/options.cpp')
-rw-r--r-- | plugins/MirOTR/src/options.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp index c547d7afde..fed648e2c4 100644 --- a/plugins/MirOTR/src/options.cpp +++ b/plugins/MirOTR/src/options.cpp @@ -86,11 +86,10 @@ void LoadOptions() { DBVARIANT dbv; if (!db_get_utf(0, MODULENAME, "Prefix", &dbv)) { - strncpy(options.prefix, dbv.pszVal, OPTIONS_PREFIXLEN-1); - options.prefix[OPTIONS_PREFIXLEN-1] = 0; + mir_strncpy(options.prefix, dbv.pszVal, OPTIONS_PREFIXLEN); db_free(&dbv); } else - strncpy(options.prefix, OPTIONS_DEFAULT_PREFIX, OPTIONS_PREFIXLEN-1); + mir_strncpy(options.prefix, OPTIONS_DEFAULT_PREFIX, OPTIONS_PREFIXLEN); options.end_offline = (db_get_b(0, MODULENAME, "EndOffline", 1) == 1); options.end_window_close = (db_get_b(0, MODULENAME, "EndWindowClose", 0) == 1); @@ -267,9 +266,9 @@ static INT_PTR CALLBACK DlgProcMirOTROpts(HWND hwndDlg, UINT msg, WPARAM wParam, mir_free(prefix); if(!prefix_utf[0]){ SetDlgItemTextA(hwndDlg, IDC_ED_PREFIX, OPTIONS_DEFAULT_PREFIX); - strncpy(options.prefix, OPTIONS_DEFAULT_PREFIX, OPTIONS_PREFIXLEN-1); + mir_strncpy(options.prefix, OPTIONS_DEFAULT_PREFIX, OPTIONS_PREFIXLEN); } else - strncpy(options.prefix, prefix_utf, OPTIONS_PREFIXLEN-1); + mir_strncpy(options.prefix, prefix_utf, OPTIONS_PREFIXLEN); mir_free(prefix_utf); SaveOptions(); |