library: minor tweaks of program logic and/or comments
This commit just corrects the oversight wherein 'item' was being employed when 'these' was actually intended. Also, it trades some 'item' use for a more descriptive input parameter which henceforth is known as a 'dest'. And, there was one leftover 'next' pointer eliminated. Finally, some logic was made a tad less dependent upon enumerator names and a few comments were also updated. Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
@@ -689,7 +689,7 @@ static int stack_items_valid (
|
||||
int i;
|
||||
|
||||
for (i = 0; i < maxitems; i++) {
|
||||
if (items[i] < PROCPS_SLABNODE_SIZE)
|
||||
if (items[i] < 0)
|
||||
return 0;
|
||||
if (items[i] > PROCPS_SLABNODE_stack_end)
|
||||
return 0;
|
||||
@@ -737,7 +737,7 @@ PROCPS_EXPORT struct slabnode_stack **procps_slabnode_stacks_alloc (
|
||||
list_size = sizeof(struct slab_result) * maxitems; // a results stack
|
||||
blob_size = sizeof(struct stacks_anchor); // the anchor itself
|
||||
blob_size += vect_size; // all vectors + delims
|
||||
blob_size += head_size * maxstacks; // all head structs + user stuff
|
||||
blob_size += head_size * maxstacks; // all head structs
|
||||
blob_size += list_size * maxstacks; // all results stacks
|
||||
|
||||
/* note: all memory is allocated in a single blob, facilitating a later free().
|
||||
|
Reference in New Issue
Block a user