diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-10-02 17:44:14 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-10-02 17:44:14 +0000 |
commit | b401c07a07c37df7310dfbd0066e4d157dc01a19 (patch) | |
tree | 6bdadb17cc761b2478b3d5cb9077723b1b54bd80 /plugins/SpellChecker/src/utils.cpp | |
parent | b5a64faccf855f5afa8ae473fdd19243c40bb165 (diff) |
SpellChecker: coverity fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@15495 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SpellChecker/src/utils.cpp')
-rw-r--r-- | plugins/SpellChecker/src/utils.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index a53953991e..e1804a25f7 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -896,7 +896,7 @@ int AddContactTextBox(MCONTACT hContact, HWND hwnd, char *name, BOOL srmm, HWND dlg->hContact = hContact;
dlg->hwnd = hwnd;
- strncpy(dlg->name, name, sizeof(dlg->name));
+ strncpy(dlg->name, name, _countof(dlg->name));
dlg->enabled = db_get_b(dlg->hContact, MODULE_NAME, dlg->name, 1);
dlg->srmm = srmm;
@@ -1578,11 +1578,7 @@ BOOL lstreq(TCHAR *a, TCHAR *b, size_t len) {
a = CharLower(_tcsdup(a));
b = CharLower(_tcsdup(b));
- BOOL ret;
- if (len >= 0)
- ret = !_tcsncmp(a, b, len);
- else
- ret = !mir_tstrcmp(a, b);
+ BOOL ret = len ? !_tcsncmp(a, b, len) : !mir_tstrcmp(a, b);
free(a);
free(b);
return ret;
|