From dd880011144001c8035a300c340c8e643daf5586 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Fri, 20 Jul 2018 09:00:42 +0200 Subject: [PATCH] sa_common.c: Fix pointer signedness difference warning from gcc MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Remove "unsigned" attribute to avoid warning from gcc: sa_common.c: In function ‘add_list_item’: sa_common.c:2516:20: warning: pointer targets in assignment from ‘unsigned char *’ to ‘char *’ differ in signedness [-Wpointer-sign] if ((e->item_name = (unsigned char *) malloc(len + 1)) == NULL) { ^ Signed-off-by: Sebastien GODARD --- sa_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sa_common.c b/sa_common.c index ecb4c67..9726529 100644 --- a/sa_common.c +++ b/sa_common.c @@ -2513,7 +2513,7 @@ int add_list_item(struct sa_item **list, char *item_name, int max_len) /* Item not found: Add it to the list */ SREALLOC(*list, struct sa_item, sizeof(struct sa_item)); e = *list; - if ((e->item_name = (unsigned char *) malloc(len + 1)) == NULL) { + if ((e->item_name = (char *) malloc(len + 1)) == NULL) { perror("malloc"); exit(4); } -- 2.40.0