git: cgram(6): Don't move over the last char and fix an assertion

Aaron LI aly at crater.dragonflybsd.org
Mon Feb 22 06:34:03 PST 2021


commit 18d09f18cf4c93d9a07b8129fed0bdc0d0b967a7
Author: Aaron LI <aly at aaronly.me>
Date:   Mon Feb 22 22:22:53 2021 +0800

    cgram(6): Don't move over the last char and fix an assertion
    
    The maximum value of cursor_x was the text length and thus also
    *equaled* to extent_x, which broke the assertion in substitute()
    and caused crashes.
    
    In addition, the cursor could move just beyond the last character
    on a line, which didn't make much sense.
    
    So only allow the cursor move to the last char but not over it.
    This also properly fix the above assertion issue.

Summary of changes:
 games/cgram/cgram.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/18d09f18cf4c93d9a07b8129fed0bdc0d0b967a7


-- 
DragonFly BSD source repository



More information about the Commits mailing list