From 365a94b62df6144ad016e587f3756d974b6e2018 Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Sat, 30 Dec 2023 20:49:48 +0100 Subject: Add explicit cast after memory allocation Still valid c, but now also valid c++. Signed-off-by: Tim Wiederhake --- src/list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/list.c') diff --git a/src/list.c b/src/list.c index f7fa724..cceba24 100644 --- a/src/list.c +++ b/src/list.c @@ -90,7 +90,7 @@ AddToList(name_list ** list_head, char *name, char *ptr) if (!list_head) return; /* ignore empty inserts */ - nptr = malloc(sizeof(name_list)); + nptr = (name_list *) malloc(sizeof(name_list)); if (nptr == NULL) { parseWarning("unable to allocate %lu bytes for name_list", (unsigned long) sizeof(name_list)); -- cgit v1.2.3