summaryrefslogtreecommitdiff
path: root/validat1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'validat1.cpp')
-rw-r--r--validat1.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/validat1.cpp b/validat1.cpp
index 9935bbd..680314c 100644
--- a/validat1.cpp
+++ b/validat1.cpp
@@ -130,7 +130,10 @@ bool TestSettings()
cout << "\nTesting Settings...\n\n";
- if (*(word32 *)"\x01\x02\x03\x04" == 0x04030201L)
+ word32 w;
+ memcpy_s(&w, sizeof(w), "\x01\x02\x03\x04", 4);
+
+ if (w == 0x04030201L)
{
#ifdef IS_LITTLE_ENDIAN
cout << "passed: ";
@@ -140,7 +143,7 @@ bool TestSettings()
#endif
cout << "Your machine is little endian.\n";
}
- else if (*(word32 *)"\x01\x02\x03\x04" == 0x01020304L)
+ else if (w == 0x01020304L)
{
#ifndef IS_LITTLE_ENDIAN
cout << "passed: ";