mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-29 05:35:26 +03:00
Ensure line lengths cache is created initialised to zero.
This commit is contained in:
parent
b89fb480db
commit
555276b04a
@ -934,10 +934,9 @@ static bool textarea_reflow_multiline(struct textarea *ta,
|
||||
assert(ta->flags & TEXTAREA_MULTILINE);
|
||||
|
||||
if (ta->lines == NULL) {
|
||||
ta->lines =
|
||||
malloc(LINE_CHUNK_SIZE * sizeof(struct line_info));
|
||||
ta->lines = calloc(sizeof(struct line_info), LINE_CHUNK_SIZE);
|
||||
if (ta->lines == NULL) {
|
||||
LOG(("malloc failed"));
|
||||
LOG(("Failed to allocate memory for textarea lines"));
|
||||
return false;
|
||||
}
|
||||
ta->lines_alloc_size = LINE_CHUNK_SIZE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user