diff options
author | Matthias Clasen <mclasen@redhat.com> | 2005-04-07 19:13:09 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2005-04-07 19:13:09 +0000 |
commit | c0e5adcf3b51330d9f51cb38f54a1a5297e0a48d (patch) | |
tree | 7bc57a21d758363fee3de781dc686ce231e6fdf7 | |
parent | 116699db55db42f20f8805016f6877b652a9e34f (diff) | |
download | gdk-pixbuf-c0e5adcf3b51330d9f51cb38f54a1a5297e0a48d.tar.gz |
Avoid unaligned access. (#172947)
2005-04-07 Matthias Clasen <mclasen@redhat.com>
* gtk/updateiconcache.c (write_card32, write_card16): Avoid
unaligned access. (#172947)
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 3 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 3 | ||||
-rw-r--r-- | gtk/updateiconcache.c | 10 |
4 files changed, 13 insertions, 6 deletions
@@ -1,5 +1,8 @@ 2005-04-07 Matthias Clasen <mclasen@redhat.com> + * gtk/updateiconcache.c (write_card32, write_card16): Avoid + unaligned access. (#172947) + Some fixes from Morten Welinder (#172947): * gtk/updateiconcache.c (icon_name_hash): Make this compiler- diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e3040094b..eacdaa3ba 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2005-04-07 Matthias Clasen <mclasen@redhat.com> + * gtk/updateiconcache.c (write_card32, write_card16): Avoid + unaligned access. (#172947) + Some fixes from Morten Welinder (#172947): * gtk/updateiconcache.c (icon_name_hash): Make this compiler- diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e3040094b..eacdaa3ba 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,8 @@ 2005-04-07 Matthias Clasen <mclasen@redhat.com> + * gtk/updateiconcache.c (write_card32, write_card16): Avoid + unaligned access. (#172947) + Some fixes from Morten Welinder (#172947): * gtk/updateiconcache.c (icon_name_hash): Make this compiler- diff --git a/gtk/updateiconcache.c b/gtk/updateiconcache.c index f9c2fbec3..1aac164ba 100644 --- a/gtk/updateiconcache.c +++ b/gtk/updateiconcache.c @@ -291,11 +291,10 @@ gboolean write_card16 (FILE *cache, guint16 n) { int i; - gchar s[2]; - *((guint16 *)s) = GUINT16_TO_BE (n); + n = GUINT16_TO_BE (n); - i = fwrite (s, 2, 1, cache); + i = fwrite ((char *)&n, 2, 1, cache); return i == 1; } @@ -304,11 +303,10 @@ gboolean write_card32 (FILE *cache, guint32 n) { int i; - gchar s[4]; - *((guint32 *)s) = GUINT32_TO_BE (n); + n = GUINT32_TO_BE (n); - i = fwrite (s, 4, 1, cache); + i = fwrite ((char *)&n, 4, 1, cache); return i == 1; } |