]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(add_tabstop): Give correct size when reallocating tab_list buffer.
authorJim Meyering <jim@meyering.net>
Fri, 21 Apr 1995 04:12:33 +0000 (04:12 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 21 Apr 1995 04:12:33 +0000 (04:12 +0000)
From Geoff Odhner (geoff@franklin.com).

src/expand.c

index 7813759cffca7e1cb535d4f77755253e9402e4b8..2488711de860c8f3197d71a41ab28b1971f8c55b 100644 (file)
@@ -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;
 }