* gdb.base/exe-lock.exp (binfile): Add $EXEEXT suffix to fix
[deliverable/binutils-gdb.git] / binutils / sysdump.c
index 6b3fbdaec04f071226ff26c97925fbabcf2b7ef1..460c6915402c6f50a8eabcae33f75ea9f924b7a8 100644 (file)
@@ -119,8 +119,15 @@ fillup (unsigned char *ptr)
   int sum;
   int i;
 
-  size = getc (file) - 2;
-  fread (ptr, 1, size, file);
+  size = getc (file);
+  if (size == EOF
+      || size <= 2)
+    return 0;
+
+  size -= 2;
+  if (fread (ptr, size, 1, file) != 1)
+    return 0;
+
   sum = code + size + 2;
 
   for (i = 0; i < size; i++)
@@ -132,7 +139,7 @@ fillup (unsigned char *ptr)
   if (dump)
     dh (ptr, size);
 
-  return size - 1;
+  return size;
 }
 
 static barray
@@ -522,8 +529,7 @@ tab (int i, char *s)
   if (s)
     {
       p ();
-      printf (s);
-      printf ("\n");
+      puts (s);
     }
 }
 
This page took 0.023769 seconds and 4 git commands to generate.