diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 3ddc5f9f2bf..c302afa307f 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2001-10-26 Richard Kenner + + * gmem.c (__gnat_gmem_read_next): Properly check for EOF + 2001-10-26 Richard Kenner * decl.c (validate_size): Modify message for bad size to avoid diff --git a/gcc/ada/gmem.c b/gcc/ada/gmem.c index 809ef0b8018..772667b6295 100644 --- a/gcc/ada/gmem.c +++ b/gcc/ada/gmem.c @@ -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);