fix a use-after-free
Introduced Nov 28. Let's see if my intermittent segfaults stop now.
This commit is contained in:
parent
71ce944e81
commit
8a70fbd171
|
@ -1070,10 +1070,10 @@ static void editorProcessKeypress(lua_State* L) {
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case ENTER:
|
case ENTER:
|
||||||
{
|
{
|
||||||
erow* oldrow = &E.row[E.rowoff + E.cy];
|
|
||||||
editorInsertNewline();
|
editorInsertNewline();
|
||||||
/* auto-indent */
|
/* auto-indent */
|
||||||
for (int x = 0; x < oldrow->size && oldrow->chars[x] == ' '; ++x)
|
erow* prevrow = &E.row[E.rowoff + E.cy - 1];
|
||||||
|
for (int x = 0; x < prevrow->size && prevrow->chars[x] == ' '; ++x)
|
||||||
editorInsertChar(' ');
|
editorInsertChar(' ');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user