1
0
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:
Zdenek Kabelac 2013-11-15 12:16:50 +01:00
parent 37b7c67079
commit eb4b03768f
2 changed files with 5 additions and 0 deletions

View File

@ -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
====================================

View File

@ -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.");
}
/*