]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(set_fields): Use xcalloc in place of xmalloc+memset.
authorJim Meyering <jim@meyering.net>
Tue, 22 Jul 2003 21:53:39 +0000 (21:53 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 22 Jul 2003 21:53:39 +0000 (21:53 +0000)
src/cut.c

index baa1368722372d51076199faef641d93603850c5..71106c25210040cd1f1cb2bc701b5ade01f6b1a2 100644 (file)
--- 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++)