From 879b94d26b59990d5cc980decbfc51a71c9883f4 Mon Sep 17 00:00:00 2001
From: MikalaiR <nikolay.romanovich@narod.ru>
Date: Sun, 11 Oct 2015 13:42:51 +0000
Subject: SpellChecker: minor bugfixes

git-svn-id: http://svn.miranda-ng.org/main/trunk@15533 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
---
 plugins/SpellChecker/src/RichEdit.cpp   | 13 ++++---------
 plugins/SpellChecker/src/dictionary.cpp |  2 +-
 2 files changed, 5 insertions(+), 10 deletions(-)

(limited to 'plugins')

diff --git a/plugins/SpellChecker/src/RichEdit.cpp b/plugins/SpellChecker/src/RichEdit.cpp
index 0fdcf62e36..b93d74718d 100644
--- a/plugins/SpellChecker/src/RichEdit.cpp
+++ b/plugins/SpellChecker/src/RichEdit.cpp
@@ -296,17 +296,12 @@ int RichEdit::FixSel(CHARRANGE *to_fix, CHARRANGE sel_changed, int new_len)
 		return dif;
 
 	int newMax = sel_changed.cpMax + dif;
-	int newMin = sel_changed.cpMin + dif;
 
-	if (to_fix->cpMin >= sel_changed.cpMin)
-		to_fix->cpMin += dif;
-	else if (to_fix->cpMin >= newMin) // For dif < 0, pos beetween sel_changed.cpMax + dif and sel_changed.cpMax
-		to_fix->cpMin = newMin;
+	if      (to_fix->cpMin >= sel_changed.cpMax) to_fix->cpMin += dif;
+	else if (to_fix->cpMin >= newMax)            to_fix->cpMin = newMax;
 
-	if (to_fix->cpMax >= sel_changed.cpMax)
-		to_fix->cpMax += dif;
-	else if (to_fix->cpMax >= newMax) // For dif < 0, pos beetween sel_changed.cpMax + dif and sel_changed.cpMax
-		to_fix->cpMax = newMax;
+	if      (to_fix->cpMax >= sel_changed.cpMax) to_fix->cpMax += dif;
+	else if (to_fix->cpMax >= newMax)            to_fix->cpMax = newMax;
 
 	return dif;
 }
diff --git a/plugins/SpellChecker/src/dictionary.cpp b/plugins/SpellChecker/src/dictionary.cpp
index c21507ac6d..aecca478b1 100644
--- a/plugins/SpellChecker/src/dictionary.cpp
+++ b/plugins/SpellChecker/src/dictionary.cpp
@@ -812,7 +812,7 @@ void GetDictsInfo(LIST<Dictionary> &dicts)
 void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, TCHAR *path, TCHAR *user_path, TCHAR *source)
 {
 	// Load the language files and create an array with then
-	TCHAR file[1024];
+	TCHAR file[1024] = { 0 };
 	mir_sntprintf(file, _T("%s\\*.dic"), path);
 
 	BOOL found = FALSE;
-- 
cgit v1.2.3