From: Jim Meyering Date: Fri, 21 Apr 1995 04:12:33 +0000 (+0000) Subject: (add_tabstop): Give correct size when reallocating tab_list buffer. X-Git-Tag: textutils-1_12_1~234 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=586c892910e541f9817373974089daa3bf5a2c2c;p=thirdparty%2Fcoreutils.git (add_tabstop): Give correct size when reallocating tab_list buffer. From Geoff Odhner (geoff@franklin.com). --- diff --git a/src/expand.c b/src/expand.c index 7813759cff..2488711de8 100644 --- a/src/expand.c +++ b/src/expand.c @@ -229,7 +229,8 @@ add_tabstop (tabval) if (tabval == -1) return; if (first_free_tab % TABLIST_BLOCK == 0) - tab_list = (int *) xrealloc (tab_list, first_free_tab + TABLIST_BLOCK); + tab_list = (int *) xrealloc (tab_list, first_free_tab + + TABLIST_BLOCK * sizeof (tab_list[0])); tab_list[first_free_tab++] = tabval; }