summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-07-22 21:53:39 +0000
committerJim Meyering <jim@meyering.net>2003-07-22 21:53:39 +0000
commit9239223865dced4c8c028c0c2be47a3e5c716396 (patch)
tree99f1c26c56063f95294de26d3f40d9b8e8c0b7d5 /src
parent9903c3432c62d5f003455cc96656082ebfa5ce97 (diff)
downloadcoreutils-9239223865dced4c8c028c0c2be47a3e5c716396.tar.xz
(set_fields): Use xcalloc in place of xmalloc+memset.
Diffstat (limited to 'src')
-rw-r--r--src/cut.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cut.c b/src/cut.c
index baa136872..71106c252 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -445,8 +445,7 @@ set_fields (const char *fieldstr)
the field numbers corresponding to all finite ranges
(i.e. `2-6' or `-4', but not `5-') in FIELDSTR. */
- printable_field = xmalloc ((max_range_endpoint + 1) * sizeof (int));
- memset (printable_field, 0, (max_range_endpoint + 1) * sizeof (int));
+ printable_field = xcalloc ((max_range_endpoint + 1) * sizeof (int), 1);
/* Set the array entries corresponding to integers in the ranges of RP. */
for (i = 0; i < n_rp; i++)