From 7db77d47f1ec87c1cae06fbde14b9cc7c2751793 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 10 Nov 2023 12:52:55 -0500 Subject: [PATCH] Yet another fix to the ext2spice code handling output formatting of SI values, this time to put the precision and the value in the order that is generally more accepted. The gcc compiler, at least, doesn't seem to care which order they are given in. --- ext2spice/ext2spice.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext2spice/ext2spice.c b/ext2spice/ext2spice.c index 66416ffd..5dc614cd 100644 --- a/ext2spice/ext2spice.c +++ b/ext2spice/ext2spice.c @@ -3164,7 +3164,7 @@ esSIvalue(file, value) char ptest[32]; float pvalue; - sprintf(ptest, "%.*g", value, precision); + sprintf(ptest, "%.*g", precision, value); sscanf(ptest, "%f", &pvalue); vtrunc = (int)(0.5 + (value * 1e6)); ptrunc = (int)(0.5 + (pvalue * 1e6)); @@ -3172,9 +3172,9 @@ esSIvalue(file, value) } if (suffix == '\0') - fprintf(file, "%.*g", value, precision); + fprintf(file, "%.*g", precision, value); else - fprintf(file, "%.*%c", value, precision, suffix); + fprintf(file, "%.*g%c", precision, value, suffix); } /*