Correct cast
authorKurt Pattyn <pattyn.kurt@gmail.com>
Sat, 2 Nov 2013 18:59:09 +0000 (19:59 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sat, 2 Nov 2013 18:59:44 +0000 (19:59 +0100)
Change-Id: Ic87115f738ec50fbf7d63a5483dd25b1e451348b
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
src/websockets/qwebsocketprotocol_p.cpp

index 4316a4b..c00711b 100644 (file)
@@ -176,10 +176,10 @@ void mask(char *payload, quint64 size, quint32 maskingKey)
     if (remainder)
     {
         const quint32 offset = i * static_cast<quint32>(sizeof(quint32));
-        const uchar *mask = reinterpret_cast<uchar *>(&maskingKey);
+        const char *mask = reinterpret_cast<const char *>(&maskingKey);
         for (quint32 i = 0; i < remainder; ++i)
         {
-            *(payload + offset + i) ^= static_cast<char>(mask[(i + offset) % 4]);
+            *(payload + offset + i) ^= (mask[(i + offset) % 4]);
         }
     }
 }