2.5: fix text editor issue with scrolling and an invalid memory read.

This commit is contained in:
Brecht Van Lommel
2009-05-28 23:48:29 +00:00
parent 276a75ae07
commit a741cbff82
2 changed files with 3 additions and 3 deletions

View File

@@ -119,8 +119,8 @@ static void flatten_string_append(FlattenString *fs, char c, int accum)
if(olen) fs->len*= 2;
else fs->len= 256;
nbuf= MEM_mallocN(sizeof(*fs->buf)*fs->len, "fs->buf");
naccum= MEM_mallocN(sizeof(*fs->accum)*fs->len, "fs->accum");
nbuf= MEM_callocN(sizeof(*fs->buf)*fs->len, "fs->buf");
naccum= MEM_callocN(sizeof(*fs->accum)*fs->len, "fs->accum");
if(olen) {
memcpy(nbuf, fs->buf, olen);

View File

@@ -1709,7 +1709,7 @@ static int scroll_exec(bContext *C, wmOperator *op)
screen_skip(st, lines*U.wheellinescroll);
WM_event_add_notifier(C, NC_TEXT|NA_EDITED, st->text);
ED_area_tag_redraw(CTX_wm_area(C));
return OPERATOR_FINISHED;
}