diff options
author | Ruediger Meier | 2016-02-26 11:10:24 +0100 |
---|---|---|
committer | Ruediger Meier | 2016-03-07 23:29:27 +0100 |
commit | fea1cbf7484df23a6fe0b62ccd1de271bc1f931a (patch) | |
tree | 047a4504053a7b449bce7695346a3f7edf78a068 /text-utils/col.c | |
parent | libfdisk: remove ifdef HDIO_GETGEO (diff) | |
download | kernel-qcow2-util-linux-fea1cbf7484df23a6fe0b62ccd1de271bc1f931a.tar.gz kernel-qcow2-util-linux-fea1cbf7484df23a6fe0b62ccd1de271bc1f931a.tar.xz kernel-qcow2-util-linux-fea1cbf7484df23a6fe0b62ccd1de271bc1f931a.zip |
misc: never cast void* from malloc(3) and friends
Such cast could hide serious compiler warnings in case we are
missing includes (e.g. <stdlib.h> or "xalloc.h").
See
http://stackoverflow.com/questions/605845/do-i-cast-the-result-of-malloc
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'text-utils/col.c')
-rw-r--r-- | text-utils/col.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/text-utils/col.c b/text-utils/col.c index 53f0556d3..0823573f4 100644 --- a/text-utils/col.c +++ b/text-utils/col.c @@ -362,7 +362,7 @@ int main(int argc, char **argv) int need; need = l->l_lsize ? l->l_lsize * 2 : 90; - l->l_line = (CHAR *)xrealloc((void *) l->l_line, + l->l_line = xrealloc((void *) l->l_line, (unsigned) need * sizeof(CHAR)); l->l_lsize = need; } @@ -472,7 +472,7 @@ void flush_line(LINE *l) */ if (l->l_lsize > sorted_size) { sorted_size = l->l_lsize; - sorted = (CHAR *)xrealloc((void *)sorted, + sorted = xrealloc((void *)sorted, (unsigned)sizeof(CHAR) * sorted_size); } if (l->l_max_col >= count_size) { |