library: minor fix for procps_meminfo_select
Thus function returns a pointer, not an int, so if there is
an error return NULL and not -errno.
proc/meminfo.c: In function ‘procps_meminfo_select’:
proc/meminfo.c:994:20: warning: return makes pointer from integer
without a cast [-Wint-conversion]
return -ENOMEM;
References:
commit 407f1b71de
This commit is contained in:
parent
7364e3ea89
commit
b4beb162fd
@ -991,7 +991,7 @@ PROCPS_EXPORT struct meminfo_stack *procps_meminfo_select (
|
||||
|| memcmp(info->items, items, sizeof(enum meminfo_item) * numitems)) {
|
||||
// allow for our PROCPS_MEMINFO_logical_end
|
||||
if (!(info->items = realloc(info->items, sizeof(enum meminfo_item) * (numitems + 1))))
|
||||
return -ENOMEM;
|
||||
return NULL;
|
||||
memcpy(info->items, items, sizeof(enum meminfo_item) * numitems);
|
||||
info->items[numitems] = PROCPS_MEMINFO_logical_end;
|
||||
info->numitems = numitems + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user