diff options
author | H. Peter Anvin <hpa@zytor.com> | 2002-04-30 20:53:16 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2002-04-30 20:53:16 +0000 |
commit | 87bc61964cf5d2cc2e322883d6f927a43fb53af3 (patch) | |
tree | cf5f2e9602092902807762c09912a5e520121368 /ndisasm.c | |
parent | 76690a12ad212d1f77cd1f71d7ac5a9de6eaefb6 (diff) | |
download | nasm-87bc61964cf5d2cc2e322883d6f927a43fb53af3.tar.gz nasm-87bc61964cf5d2cc2e322883d6f927a43fb53af3.tar.bz2 nasm-87bc61964cf5d2cc2e322883d6f927a43fb53af3.zip |
NASM 0.97
Diffstat (limited to 'ndisasm.c')
-rw-r--r-- | ndisasm.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -42,6 +42,7 @@ int main(int argc, char **argv) { int lenread, lendis; int autosync = FALSE; int bits = 16; + int eof = FALSE; int rn_error; long offset; FILE *fp; @@ -191,6 +192,8 @@ int main(int argc, char **argv) { if (to_read > nextsync-offset-(p-q)) to_read = nextsync-offset-(p-q); lenread = fread (p, 1, to_read, fp); + if (lenread == 0) + eof = TRUE; /* help along systems with bad feof */ p += lenread; if (offset == nextsync) { if (synclen) { @@ -218,7 +221,7 @@ int main(int argc, char **argv) { p -= (q - buffer); q = buffer; } - } while (lenread > 0 || !feof(fp)); + } while (lenread > 0 || !(eof || feof(fp))); fclose (fp); return 0; } |