summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2006-12-19 04:14:10 (GMT)
committerdas <das>2006-12-19 04:14:10 (GMT)
commitbe7ae19a2c320ef01320656e02ddd1ae8c218830 (patch)
treeb265c8e1d0348b824f1309c11b03e12438bbe229
parent5f6537a4a1f5b4f480c7027c93dd6de023a54730 (diff)
downloadtcl-be7ae19a2c320ef01320656e02ddd1ae8c218830.zip
tcl-be7ae19a2c320ef01320656e02ddd1ae8c218830.tar.gz
tcl-be7ae19a2c320ef01320656e02ddd1ae8c218830.tar.bz2
* unix/tclUnixThrd.c (TclpInetNtoa): fix for 64 bit.
-rw-r--r--ChangeLog2
-rw-r--r--unix/tclUnixThrd.c8
2 files changed, 4 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 12abf53..222fa3a 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.13
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index 30b1fc6..073e44c 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -832,13 +832,9 @@ TclpInetNtoa(struct in_addr addr)
{
#ifdef TCL_THREADS
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- union {
- unsigned long l;
- unsigned char b[4];
- } u;
+ char *b = (char*) &addr.s_addr;
- 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]);
+ sprintf(tsdPtr->nabuf, "%u.%u.%u.%u", b[0], b[1], b[2], b[3]);
return tsdPtr->nabuf;
#else
return inet_ntoa(addr);