diff options
Diffstat (limited to 'coreutils/cut.c')
-rw-r--r-- | coreutils/cut.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/coreutils/cut.c b/coreutils/cut.c index 1798549..3bac151 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c @@ -241,9 +241,10 @@ int cut_main(int argc UNUSED_PARAM, char **argv) } /* add the new list */ - cut_lists = xrealloc(cut_lists, sizeof(struct cut_list) * (++nlists)); - cut_lists[nlists-1].startpos = s; - cut_lists[nlists-1].endpos = e; + cut_lists = xrealloc_vector(cut_lists, 4, nlists); + cut_lists[nlists].startpos = s; + cut_lists[nlists].endpos = e; + nlists++; } /* make sure we got some cut positions out of all that */ |