From e6b9093f87745be1afe6738aaad51b6660a50126 Mon Sep 17 00:00:00 2001 From: Miciah Dashiel Butler Masters Date: Fri, 17 Feb 2006 16:52:38 +0000 Subject: [PATCH] find_form_state: use mem_align_alloc to save some code --- src/viewer/text/form.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/viewer/text/form.c b/src/viewer/text/form.c index 296ee990c..1ffd2d08d 100644 --- a/src/viewer/text/form.c +++ b/src/viewer/text/form.c @@ -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; }