fix for yet another off by one error in console code, could crash deleting words...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 30 Apr 2013 22:46:41 +0000 (22:46 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 30 Apr 2013 22:46:41 +0000 (22:46 +0000)
source/blender/editors/space_console/console_ops.c

index a6379e6465fe64748594b9a392f45f4ab2773ebc..c10ea96096fd11357b2ca8455de8607a5b092905 100644 (file)
@@ -570,7 +570,7 @@ static int console_delete_exec(bContext *C, wmOperator *op)
                                                         (type == DEL_NEXT_CHAR) ? STRCUR_JUMP_NONE : STRCUR_JUMP_DELIM, true);
                                stride = pos - ci->cursor;
                                if (stride) {
-                                       memmove(ci->line + ci->cursor, ci->line + ci->cursor + stride, (ci->len - ci->cursor) + 1);
+                                       memmove(ci->line + ci->cursor, ci->line + ci->cursor + stride, (ci->len - (ci->cursor + stride)) + 1);
                                        ci->len -= stride;
                                        BLI_assert(ci->len >= 0);
                                        done = TRUE;