Merge pull request #7438 from Luhrel/fixFormat

Fix incorrect use of sprintf format
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
This commit is contained in:
The Dlang Bot 2020-04-09 16:10:07 +02:00 committed by GitHub
commit 0300b493f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -243,8 +243,8 @@ version (StdUnittest) private
alias real_t = real;
() @trusted {
ix = sprintf(bufx.ptr, "%.*Lg", ndigits, cast(real_t) x);
iy = sprintf(bufy.ptr, "%.*Lg", ndigits, cast(real_t) y);
ix = sprintf(bufx.ptr, is(real_t == real) ? "%.*Lg" : "%.*g", ndigits, cast(real_t) x);
iy = sprintf(bufy.ptr, is(real_t == real) ? "%.*Lg" : "%.*g", ndigits, cast(real_t) y);
} ();
assert(ix < bufx.length && ix > 0);