1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Fix dm_report_field_uint64 to really use 64bit.

(function is currently not in use)
This commit is contained in:
Zdenek Kabelac 2010-02-15 18:36:48 +00:00
parent 810349313a
commit d98d855918

View File

@ -207,7 +207,7 @@ int dm_report_field_int32(struct dm_report *rh,
int dm_report_field_uint64(struct dm_report *rh, int dm_report_field_uint64(struct dm_report *rh,
struct dm_report_field *field, const uint64_t *data) struct dm_report_field *field, const uint64_t *data)
{ {
const int value = *data; const uint64_t value = *data;
uint64_t *sortval; uint64_t *sortval;
char *repstr; char *repstr;
@ -221,12 +221,12 @@ int dm_report_field_uint64(struct dm_report *rh,
return 0; return 0;
} }
if (dm_snprintf(repstr, 21, "%d", value) < 0) { if (dm_snprintf(repstr, 21, "%" PRIu64 , value) < 0) {
log_error("dm_report_field_uint64: uint64 too big: %d", value); log_error("dm_report_field_uint64: uint64 too big: %" PRIu64, value);
return 0; return 0;
} }
*sortval = (const uint64_t) value; *sortval = value;
field->sort_value = sortval; field->sort_value = sortval;
field->report_string = repstr; field->report_string = repstr;