mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: ensightFile.C: overflow of fieldwidth for large or small numbers
This commit is contained in:
@ -230,10 +230,10 @@ Foam::Ostream& Foam::ensightFile::write
|
||||
|
||||
Foam::Ostream& Foam::ensightFile::write(const scalar value)
|
||||
{
|
||||
float fvalue(value);
|
||||
|
||||
if (format() == IOstream::BINARY)
|
||||
{
|
||||
float fvalue(value);
|
||||
|
||||
write
|
||||
(
|
||||
reinterpret_cast<char const *>(&fvalue),
|
||||
@ -243,7 +243,7 @@ Foam::Ostream& Foam::ensightFile::write(const scalar value)
|
||||
else
|
||||
{
|
||||
stdStream().width(12);
|
||||
stdStream() << value;
|
||||
stdStream() << fvalue;
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
||||
Reference in New Issue
Block a user