From: Jim Meyering Date: Tue, 3 Oct 1995 20:28:44 +0000 (+0000) Subject: (set_fields): Use memset (not open coded loop) to initialize array. X-Git-Tag: FILEUTILS-3_12f~125 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=111cb717e8a982aa7030b891c99cd2c9c135bf22;p=thirdparty%2Fcoreutils.git (set_fields): Use memset (not open coded loop) to initialize array. --- diff --git a/src/cut.c b/src/cut.c index b348757988..89d2add951 100644 --- a/src/cut.c +++ b/src/cut.c @@ -464,8 +464,7 @@ set_fields (const char *fieldstr) (i.e. `2-6' or `-4', but not `5-') in FIELDSTR. */ printable_field = (int *) xmalloc ((max_range_endpoint + 1) * sizeof (int)); - for (i = 1; i <= max_range_endpoint; i++) - printable_field[i] = 0; + memset (printable_field, 0, (max_range_endpoint + 1) * sizeof (int)); /* Set the array entries corresponding to integers in the ranges of RP. */ for (i = 0; i < n_rp; i++)