summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-04-07 19:13:09 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-04-07 19:13:09 +0000
commitc0e5adcf3b51330d9f51cb38f54a1a5297e0a48d (patch)
tree7bc57a21d758363fee3de781dc686ce231e6fdf7
parent116699db55db42f20f8805016f6877b652a9e34f (diff)
downloadgtk+-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--ChangeLog3
-rw-r--r--ChangeLog.pre-2-103
-rw-r--r--ChangeLog.pre-2-83
-rw-r--r--gtk/updateiconcache.c10
4 files changed, 13 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index e3040094b9..eacdaa3baa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 e3040094b9..eacdaa3baa 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 e3040094b9..eacdaa3baa 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 f9c2fbec3d..1aac164ba7 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;
}