From badecb3f6ce21e9ad12402d4dd96d9a532499710 Mon Sep 17 00:00:00 2001 From: Assaf Gordon Date: Mon, 29 Jun 2015 12:54:41 +0100 Subject: [PATCH] numfmt: fix printf argument order MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * src/numfmt.c (double_to_human): Fix the argument order passed to snprintf, which happened to work on amd64 with its separate va_arg storage area for floats¹, but would fail tests for example on i686. ¹ https://blog.nelhage.com/2010/10/amd64-and-va_arg/ --- src/numfmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/numfmt.c b/src/numfmt.c index 4af16faea0..09cdd422f1 100644 --- a/src/numfmt.c +++ b/src/numfmt.c @@ -794,7 +794,7 @@ double_to_human (long double val, int precision, int prec = user_precision == -1 ? show_decimal_point : user_precision; /* buf_size - 1 used here to ensure place for possible scale_IEC_I suffix. */ - num_size = snprintf (buf, buf_size - 1, fmt, val, prec, + num_size = snprintf (buf, buf_size - 1, fmt, prec, val, suffix_power_char (power)); if (num_size < 0 || num_size >= (int) buf_size - 1) error (EXIT_FAILURE, 0, -- 2.47.2