repochecker/grammalecte: Fix odd slice bounds out of range

This commit is contained in:
nemunaire 2022-11-05 01:53:03 +01:00
parent ae1378780f
commit 4b8e447b1b
1 changed files with 1 additions and 1 deletions

View File

@ -187,7 +187,7 @@ func grammalecte(name string, text string, exceptions *sync.CheckExceptions, opt
continue
}
if gerror.RuleId == "mc_mot_composé" && exceptions.HasException(fmt.Sprintf(":spelling:%s", data.Text[gerror.Start+1:gerror.End+1])) {
if gerror.RuleId == "mc_mot_composé" && gerror.End+1 < len(data.Text) && gerror.Start+1 < len(data.Text) && exceptions.HasException(fmt.Sprintf(":spelling:%s", data.Text[gerror.Start+1:gerror.End+1])) {
continue
}