mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
find_form_state: use mem_align_alloc to save some code
This commit is contained in:
parent
fae675316b
commit
e6b9093f87
@ -206,10 +206,9 @@ find_form_state(struct document_view *doc_view, struct form_control *fc)
|
||||
if (n >= vs->form_info_len) {
|
||||
int nn = n + 1;
|
||||
|
||||
fs = mem_realloc(vs->form_info, nn * sizeof(*fs));
|
||||
fs = mem_align_alloc(&vs->form_info, vs->form_info_len, nn,
|
||||
struct form_state, 0);
|
||||
if (!fs) return NULL;
|
||||
memset(fs + vs->form_info_len, 0,
|
||||
(nn - vs->form_info_len) * sizeof(*fs));
|
||||
vs->form_info = fs;
|
||||
vs->form_info_len = nn;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user