library: show allowable range in relative enum warning
This patch just trades the 'typestr' for the much more meaningful 'valid range' when a relative enum has been deemed invalid under that XTRA_PROCPS_DEBUG provision. [ and we'll also make one comment a bit more generic ] Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
@ -1355,7 +1355,7 @@ PROCPS_EXPORT struct vmstat_stack *procps_vmstat_select (
|
||||
*
|
||||
* It's used only when:
|
||||
* 1) the 'XTRA_PROCPS_DEBUG' has been defined, or
|
||||
* 2) the '#include <proc/xtra-procps-debug.h>' used
|
||||
* 2) an #include of 'xtra-procps-debug.h' is used
|
||||
*/
|
||||
|
||||
PROCPS_EXPORT struct vmstat_result *xtra_vmstat_get (
|
||||
@ -1395,8 +1395,8 @@ PROCPS_EXPORT struct vmstat_result *xtra_vmstat_val (
|
||||
for (i = 0; stack->head[i].item < VMSTAT_logical_end; i++)
|
||||
;
|
||||
if (relative_enum < 0 || relative_enum >= i) {
|
||||
fprintf(stderr, "%s line %d: invalid relative_enum = %d, type = %s\n"
|
||||
, file, lineno, relative_enum, typestr);
|
||||
fprintf(stderr, "%s line %d: invalid relative_enum = %d, valid range = 0-%d\n"
|
||||
, file, lineno, relative_enum, i-1);
|
||||
return NULL;
|
||||
}
|
||||
str = Item_table[stack->head[relative_enum].item].type2str;
|
||||
|
Reference in New Issue
Block a user