From 8a9b564349c8e0c0ec7f5c1a97e0c29276188ea0 Mon Sep 17 00:00:00 2001 From: das Date: Wed, 9 May 2007 12:51:30 +0000 Subject: * generic/tkFileFilter.c (AddClause): OSType endianness fixes. --- generic/tkFileFilter.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/generic/tkFileFilter.c b/generic/tkFileFilter.c index 0ae1e64..06e63d6 100644 --- a/generic/tkFileFilter.c +++ b/generic/tkFileFilter.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFileFilter.c,v 1.9 2005/11/04 11:52:50 dkf Exp $ + * RCS: @(#) $Id: tkFileFilter.c,v 1.10 2007/05/09 12:51:30 das Exp $ */ #include "tkInt.h" @@ -347,6 +347,7 @@ AddClause( int len; MacFileType *mfPtr = (MacFileType *) ckalloc(sizeof(MacFileType)); CONST char *strType = Tcl_GetStringFromObj(ostypeList[i], &len); + char *string; /* * Convert utf to macRoman, since MacOS types are defined to be 4 @@ -354,8 +355,9 @@ AddClause( */ Tcl_UtfToExternalDString(macRoman, strType, len, &osTypeDS); - - memcpy(&mfPtr->type, Tcl_DStringValue(&osTypeDS), sizeof(OSType)); + string = Tcl_DStringValue(&osTypeDS); + mfPtr->type = (OSType) string[0] << 24 | (OSType) string[1] << 16 | + (OSType) string[2] << 8 | (OSType) string[3]; Tcl_DStringFree(&osTypeDS); /* -- cgit v0.12