hud: fix values printing

Oops...

Fixes: 595079c37c ("hud: extract float printf modifer selection logic to helper")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20643>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2023-01-11 15:02:12 +01:00
parent 63203f94e8
commit ab9a9f702a

View File

@ -313,9 +313,9 @@ number_to_human_readable(double num, enum pipe_driver_query_type type,
d /= divisor;
unit++;
}
sprintf(out, get_float_modifier(d), d);
sprintf(out, "%s", units[unit]);
int n = sprintf(out, get_float_modifier(d), d);
if (n > 0)
sprintf(&out[n], "%s", units[unit]);
}
static void