OSDN Git Service

* gmem.c (__gnat_gmem_read_next): Properly check for EOF
authorbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Oct 2001 17:03:05 +0000 (17:03 +0000)
committerbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Oct 2001 17:03:05 +0000 (17:03 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46552 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/gmem.c

index 3ddc5f9..c302afa 100644 (file)
@@ -1,5 +1,9 @@
 2001-10-26  Richard Kenner <kenner@gnat.com>
 
+       * gmem.c (__gnat_gmem_read_next): Properly check for EOF
+
+2001-10-26  Richard Kenner <kenner@gnat.com>
+
        * decl.c (validate_size): Modify message for bad size to avoid 
        implication that compiler is modifying the size.
 
index 809ef0b..772667b 100644 (file)
@@ -112,7 +112,7 @@ __gnat_gmem_initialize (dumpname)
       fclose (gmemfile);
       return 0;
     }
-  
+
   return 1;
 }
 
@@ -140,16 +140,17 @@ __gnat_gmem_read_next (buf)
 {
   void *addr;
   int size;
-  char c;
+  int j;
 
-  if ((c = fgetc (gmemfile)) == EOF)
+  j = fgetc (gmemfile);
+  if (j == EOF)
     {
       fclose (gmemfile);
       sprintf (buf, "Program exited.");
     }
   else
     {
-      switch (c)
+      switch (j)
         {
           case 'A' :
             fread (&addr, sizeof (char *), 1, gmemfile);