From: Sebastien GODARD Date: Fri, 20 Jul 2018 07:00:42 +0000 (+0200) Subject: sa_common.c: Fix pointer signedness difference warning from gcc X-Git-Tag: v12.0.0~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd880011144001c8035a300c340c8e643daf5586;p=sysstat sa_common.c: Fix pointer signedness difference warning from gcc 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 --- 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); }