Index: /branches/eam_branches/ohana.20150429/src/libfits/header/F_modify.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/libfits/header/F_modify.c	(revision 38416)
+++ /branches/eam_branches/ohana.20150429/src/libfits/header/F_modify.c	(revision 38417)
@@ -48,5 +48,5 @@
     strncpy (comment, qe, p + 80 - qe);
   }
-  gfits_pad_ending (comment, ' ', 82);  /* comment must contain spaces to the end */
+  gfits_pad_ending (comment, 0x20, 82);  /* comment must contain spaces to the end */
 
   /* write the numeric modes */
@@ -134,5 +134,5 @@
     strncpy (comment, qe, p + 80 - qe);
   }
-  gfits_pad_ending (comment, ' ', 82);  /* comment must contain spaces to the end */
+  gfits_pad_ending (comment, 0x20, 82);  /* comment must contain spaces to the end */
 
   /* write the boolean mode */
@@ -166,5 +166,5 @@
     if (!ptr) goto invalid;
     strncpy (comment, ptr, 80);
-    gfits_pad_ending (comment, ' ', 82);  /* comment must contain spaces to the end */
+    gfits_pad_ending (comment, 0x20, 82);  /* comment must contain spaces to the end */
     snprintf (string, 81, "%-8s= %s / %-s", field, data, comment);
     /* this will keep the original line, but truncate the comment */
@@ -296,15 +296,23 @@
  */
 
+// XXX this is an absurd patch on a gcc bug: memset has a problem is value != 0 and N is constant
+void myMemset (char *ptr, int value, size_t N) {
+
+  char *p = ptr;
+  
+  size_t i = 0;
+  for (i = 0; i < N; i++, p++) {
+    *p = value;
+  }
+}
+
 /* fill 'line' with Nbyte space from first NULL to last byte with value */
 void gfits_pad_ending (char *line, char value, int Nbyte) {
-  
-  char *p;
-  int N;
 
   line[Nbyte-1] = 0;
   
-  p = line + strlen (line);
-  N = MAX (Nbyte - strlen (line) - 1, 0);
-  memset (p, value, N);
+  char *p = line + strlen (line);
+  size_t N = MAX (Nbyte - strlen (line) - 1, 0);
+  myMemset (p, value, N);
 }
 
