summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qdatastream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qdatastream.cpp')
-rw-r--r--src/corelib/io/qdatastream.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp
index 9a71f60854..5e5e155534 100644
--- a/src/corelib/io/qdatastream.cpp
+++ b/src/corelib/io/qdatastream.cpp
@@ -1046,8 +1046,12 @@ QDataStream &QDataStream::operator<<(float f)
} x;
x.val1 = g;
x.val2 = qbswap(x.val2);
- g = x.val1;
+
+ if (dev->write((char *)&x.val2, sizeof(float)) != sizeof(float))
+ q_status = WriteFailed;
+ return *this;
}
+
if (dev->write((char *)&g, sizeof(float)) != sizeof(float))
q_status = WriteFailed;
return *this;