Index: plug-ins/winicon/icoload.c
===================================================================
RCS file: /cvs/gnome/gimp/plug-ins/winicon/icoload.c,v
retrieving revision 1.13
diff -u -p -r1.13 icoload.c
--- plug-ins/winicon/icoload.c	30 Sep 2005 08:16:10 -0000	1.13
+++ plug-ins/winicon/icoload.c	14 Feb 2006 10:18:22 -0000
@@ -263,7 +263,7 @@ ico_get_bit_from_data (const guint8 *dat
   line = bit / line_width;
   offset = bit % line_width;
 
-  result = (data[line * width32 * 4 + offset/8] & (1 << (7 - (bit % 8))));
+  result = (data[line * width32 * 4 + offset/8] & (1 << (7 - (offset % 8))));
 
   return (result ? 1 : 0);
 }
@@ -285,9 +285,9 @@ ico_get_nibble_from_data (const guint8 *
   offset = nibble % line_width;
 
   result =
-    (data[line * width32 * 4 + offset/2] & (0x0F << (4 * (1 - nibble % 2))));
+    (data[line * width32 * 4 + offset/2] & (0x0F << (4 * (1 - offset % 2))));
 
-  if (nibble % 2 == 0)
+  if (offset % 2 == 0)
     result = result >> 4;
 
   return result;
Index: plug-ins/winicon/icosave.c
===================================================================
RCS file: /cvs/gnome/gimp/plug-ins/winicon/icosave.c,v
retrieving revision 1.19
diff -u -p -r1.19 icosave.c
--- plug-ins/winicon/icosave.c	30 Sep 2005 08:16:10 -0000	1.19
+++ plug-ins/winicon/icosave.c	14 Feb 2006 10:18:22 -0000
@@ -296,7 +296,7 @@ ico_set_bit_in_data (guint8 *data,
   offset = bit_num % line_width;
   bit_val = bit_val & 0x00000001;
 
-  data[line * width32 * 4 + offset/8] |= (bit_val << (7 - (bit_num % 8)));
+  data[line * width32 * 4 + offset/8] |= (bit_val << (7 - (offset % 8)));
 }
 
 
@@ -317,7 +317,7 @@ ico_set_nibble_in_data (guint8 *data,
   offset = nibble_num % line_width;
   nibble_val = nibble_val & 0x0000000F;
 
-  data[line * width8 * 4 + offset/2] |= (nibble_val << (4 * (1 - (nibble_num % 2))));
+  data[line * width8 * 4 + offset/2] |= (nibble_val << (4 * (1 - (offset % 2))));
 }
 
 
