summaryrefslogtreecommitdiffstats
path: root/sys-utils/swapon-common.c
diff options
context:
space:
mode:
authorRuediger Meier2016-02-26 11:10:24 +0100
committerRuediger Meier2016-03-07 23:29:27 +0100
commitfea1cbf7484df23a6fe0b62ccd1de271bc1f931a (patch)
tree047a4504053a7b449bce7695346a3f7edf78a068 /sys-utils/swapon-common.c
parentlibfdisk: remove ifdef HDIO_GETGEO (diff)
downloadkernel-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 'sys-utils/swapon-common.c')
-rw-r--r--sys-utils/swapon-common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys-utils/swapon-common.c b/sys-utils/swapon-common.c
index 75466a056..8b686c0cd 100644
--- a/sys-utils/swapon-common.c
+++ b/sys-utils/swapon-common.c
@@ -86,7 +86,7 @@ static size_t ulct;
void add_label(const char *label)
{
- llist = (const char **) xrealloc(llist, (++llct) * sizeof(char *));
+ llist = xrealloc(llist, (++llct) * sizeof(char *));
llist[llct - 1] = label;
}
@@ -102,7 +102,7 @@ size_t numof_labels(void)
void add_uuid(const char *uuid)
{
- ulist = (const char **) xrealloc(ulist, (++ulct) * sizeof(char *));
+ ulist = xrealloc(ulist, (++ulct) * sizeof(char *));
ulist[ulct - 1] = uuid;
}