* gmem.c (__gnat_gmem_read_next): Properly check for EOF

From-SVN: r46552
This commit is contained in:
Richard Kenner 2001-10-26 17:03:05 +00:00 committed by Geert Bosch
parent 5b09c15368
commit c0b1738da2
2 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,7 @@
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

View 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);