summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2006-12-19 04:13:54 (GMT)
committerdas <das>2006-12-19 04:13:54 (GMT)
commitf4fdf5029fdd786efd3ac874e5bf2143e93e07ba (patch)
treec2b5abe0a13b8cffbe1ae8b955dfeba88a74fec5
parentd5e703212bc135fbc0065ee939c6c3fa32871e6b (diff)
downloadtcl-f4fdf5029fdd786efd3ac874e5bf2143e93e07ba.zip
tcl-f4fdf5029fdd786efd3ac874e5bf2143e93e07ba.tar.gz
tcl-f4fdf5029fdd786efd3ac874e5bf2143e93e07ba.tar.bz2
* unix/tclUnixThrd.c (TclpInetNtoa): fix for 64 bit.
-rw-r--r--ChangeLog2
-rw-r--r--unix/tclUnixThrd.c10
2 files changed, 5 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index bb31572..cde9128 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2006-12-19 Daniel Steffen <das@users.sourceforge.net>
+ * unix/tclUnixThrd.c (TclpInetNtoa): fix for 64 bit.
+
* unix/tcl.m4 (Darwin): --enable-64bit: verify linking with 64bit -arch
flag succeeds before enabling 64bit build.
* unix/configure: autoconf-2.59
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index 815dc4f..c0a9500 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -715,13 +715,9 @@ TclpInetNtoa(
{
#ifdef TCL_THREADS
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- union {
- unsigned long l;
- unsigned char b[4];
- } u;
-
- u.l = (unsigned long) addr.s_addr;
- sprintf(tsdPtr->nabuf, "%u.%u.%u.%u", u.b[0], u.b[1], u.b[2], u.b[3]);
+ char *b = (char*) &addr.s_addr;
+
+ sprintf(tsdPtr->nabuf, "%u.%u.%u.%u", b[0], b[1], b[2], b[3]);
return tsdPtr->nabuf;
#else
return inet_ntoa(addr);