diff --git a/ChangeLog b/ChangeLog index becb3934..88ff952c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 7/3/08 started 7.15.0 -- MAGIC numbers should be unsigned -- write MAGIC correctly on sparc/powerpc machines +- MAGIC constants should be tagged as unsigned +- write MAGIC correctly on sparc/powerpc machines (thanks Joe) 25/1/08 started 7.14.0 - bump all version numbers for new stable diff --git a/libsrc/iofuncs/im_desc_hd.c b/libsrc/iofuncs/im_desc_hd.c index 23af15cb..34499fa4 100644 --- a/libsrc/iofuncs/im_desc_hd.c +++ b/libsrc/iofuncs/im_desc_hd.c @@ -186,13 +186,13 @@ im__write_header_bytes( IMAGE *im, unsigned char *to ) int i; unsigned char *q; - /* Always write MSB first. + /* Always write the magic number MSB first. */ magic = im_amiMSBfirst() ? IM_MAGIC_SPARC : IM_MAGIC_INTEL; - to[0] = (magic & 0xff000000) >> 24; - to[1] = (magic & 0xff0000) >> 16; - to[2] = (magic & 0xff00) >> 8; - to[3] = magic & 0xff; + to[0] = magic >> 24; + to[1] = magic >> 16; + to[2] = magic >> 8; + to[3] = magic; q = to + 4; for( i = 0; i < IM_NUMBER( fields ); i++ )