From 1651502a43502da5ebbbfbd50b9f3cf0c709e8f8 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 11 Sep 2022 09:57:25 -0700 Subject: Remove unnecessary casts from malloc() calls Signed-off-by: Alan Coopersmith --- process.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'process.c') diff --git a/process.c b/process.c index 6d59cb4..1ed6cab 100644 --- a/process.c +++ b/process.c @@ -413,7 +413,7 @@ read_numeric(FILE *fp) { Xauth *auth; - auth = (Xauth *) malloc (sizeof (Xauth)); + auth = malloc (sizeof (Xauth)); if (!auth) goto bad; auth->family = 0; auth->address = NULL; @@ -469,7 +469,7 @@ read_auth_entries(FILE *fp, Bool numeric, AuthList **headp, AuthList **tailp) n = 0; /* put all records into linked list */ while ((auth = ((*readfunc) (fp))) != NULL) { - AuthList *l = (AuthList *) malloc (sizeof (AuthList)); + AuthList *l = malloc (sizeof (AuthList)); if (!l) { fprintf (stderr, "%s: unable to alloc entry reading auth file\n", @@ -956,7 +956,7 @@ bintohex(unsigned int len, const char *bindata) char *hexdata, *starthex; /* two chars per byte, plus null termination */ - starthex = hexdata = (char *)malloc(2*len + 1); + starthex = hexdata = malloc((2 * len) + 1); if (!hexdata) return NULL; @@ -1227,7 +1227,7 @@ copyAuth(Xauth *auth) { Xauth *a; - a = (Xauth *)malloc(sizeof(Xauth)); + a = malloc(sizeof(Xauth)); if (a == NULL) { return NULL; } -- cgit v1.2.1