summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-04-21 04:12:33 +0000
committerJim Meyering <jim@meyering.net>1995-04-21 04:12:33 +0000
commit586c892910e541f9817373974089daa3bf5a2c2c (patch)
tree2e77c40af0369d8f8793ddd1af942b8aca07830f /src
parentf9834f6bee3d07ab8a68d31cbbcf5ab6500340bd (diff)
downloadcoreutils-586c892910e541f9817373974089daa3bf5a2c2c.tar.xz
(add_tabstop): Give correct size when reallocating tab_list buffer.
From Geoff Odhner (geoff@franklin.com).
Diffstat (limited to 'src')
-rw-r--r--src/expand.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/expand.c b/src/expand.c
index 7813759cf..2488711de 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;
}