From 62855ff82acb66197569d1754e5da7a777d40f0b Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Wed, 16 Aug 2023 13:16:39 +0200 Subject: [PATCH] fosphor/axis: Fix warning in printf about possible buffer overrun Signed-off-by: Sylvain Munaut --- lib/fosphor/axis.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/fosphor/axis.c b/lib/fosphor/axis.c index 4d4074a..6219fe3 100644 --- a/lib/fosphor/axis.c +++ b/lib/fosphor/axis.c @@ -29,7 +29,7 @@ static double -_si_scaling(double val, int max_num, char *prefix, int *exp) +_si_scaling(double val, int max_num, char *prefix, unsigned int *exp) { const char prefixes[5] = { ' ', 'k', 'M', 'G', 'T' }; int exponent = log10f(fabs(val)); @@ -84,7 +84,7 @@ freq_axis_build(struct freq_axis *fx, double center, double span, int n_div) { double min_freq, max_freq, big_freq; char prefix[2] = {0, 0}; - int exp, x, y, z; + unsigned int exp, x, y, z; max_freq = fx->center + (span / 2.0); min_freq = fx->center - (span / 2.0); @@ -117,7 +117,7 @@ freq_axis_build(struct freq_axis *fx, double center, double span, int n_div) { double max_dev = fx->step * 5; char prefix[2] = {0, 0}; - int exp, x, y; + unsigned int exp, x, y; _si_scaling(max_dev, 3, prefix, &exp);