]> git.lyx.org Git - features.git/commitdiff
avoid spell check with out of range start value
authorStephan Witt <switt@lyx.org>
Mon, 6 Sep 2010 06:55:31 +0000 (06:55 +0000)
committerStephan Witt <switt@lyx.org>
Mon, 6 Sep 2010 06:55:31 +0000 (06:55 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35292 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/AppleSpeller.m

index feba78c1a1b4b55cfee4509d20e24390b9c47153..aecb787551aa6440276e8c2703359fdb1932b823 100644 (file)
@@ -94,11 +94,12 @@ SpellCheckResult AppleSpeller_check(AppleSpeller speller, const char * word, con
        NSString * lang_ = toString(lang);
        SpellCheckResult result = SPELL_CHECK_FAILED;
        int start = 0;
-
+       int length = [word_ length];
+       
        [speller->misspelled release];
        speller->misspelled = nil;
 
-       while (result == SPELL_CHECK_FAILED) {
+       while (result == SPELL_CHECK_FAILED && start < length) {
                NSRange match = [speller->checker
                        checkSpellingOfString:word_
                        startingAt:start