mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
libdm: catch wrongly reported values
Add internal error warning when string value is used as sort value for numerical field. Using log_warn since the function itself does not return error, so we do not confuse log_error() checker.
This commit is contained in:
parent
37b7c67079
commit
eb4b03768f
@ -1,5 +1,6 @@
|
||||
Version 1.02.84 -
|
||||
====================================
|
||||
Catch invalid use of string sort values when reporting numerical fields.
|
||||
|
||||
Version 1.02.83 - 13th November 2013
|
||||
====================================
|
||||
|
@ -240,6 +240,10 @@ void dm_report_field_set_value(struct dm_report_field *field, const void *value,
|
||||
{
|
||||
field->report_string = (const char *) value;
|
||||
field->sort_value = sortvalue ? : value;
|
||||
|
||||
if ((field->sort_value == value) &&
|
||||
(field->props->flags & DM_REPORT_FIELD_TYPE_NUMBER))
|
||||
log_warn(INTERNAL_ERROR "Using string as sort value for numerical field.");
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user