aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-05-11 17:22:01 +0000
committerdrh <drh@noemail.net>2008-05-11 17:22:01 +0000
commit0a66733a29fbf21f98f58564ad36badcc8d7904f (patch)
tree1c4b2c8d3c4e29d62520b20c96732b0970b73442 /src
parenta06f17fe2e432db1c0782055a0febd837880ca88 (diff)
downloadsqlite-0a66733a29fbf21f98f58564ad36badcc8d7904f.tar.gz
sqlite-0a66733a29fbf21f98f58564ad36badcc8d7904f.zip
Use memcpy() instead of casting to copy the content of a long long int
into a double. Ticket #3101. (CVS 5117) FossilOrigin-Name: 88e12caca99d1d54cfe6228cb0de1eccc93fcc74
Diffstat (limited to 'src')
-rw-r--r--src/test1.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test1.c b/src/test1.c
index 5eaef8a8d..116322701 100644
--- a/src/test1.c
+++ b/src/test1.c
@@ -13,7 +13,7 @@
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
-** $Id: test1.c,v 1.302 2008/05/11 11:07:07 drh Exp $
+** $Id: test1.c,v 1.303 2008/05/11 17:22:01 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@@ -2654,7 +2654,9 @@ static int test_bind_double(
x = aSpecialFp[i].iUpper;
x <<= 32;
x |= aSpecialFp[i].iLower;
- value = *(double*)(char*)&x;
+ assert( sizeof(value)==8 );
+ assert( sizeof(x)==8 );
+ memcpy(&value, &x, 8);
break;
}
}