diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-11-20 13:22:58 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-11-20 13:22:58 -0800 |
commit | 49da46883087678aedaa7a9703fdbb617b784fc6 (patch) | |
tree | d58727d12bdb7b56d027ec2588363db82c5357ee /ndisasm.c | |
parent | 2a15e69ebe0c99a1997952e63c6702c05aa93db0 (diff) | |
download | nasm-49da46883087678aedaa7a9703fdbb617b784fc6.tar.gz nasm-49da46883087678aedaa7a9703fdbb617b784fc6.tar.bz2 nasm-49da46883087678aedaa7a9703fdbb617b784fc6.zip |
ndisasm: handle the case of "no more sync points"
Handle the case of "no more sync points" explicitly, instead of saying
the next sync point is at UINT32_MAX.
Diffstat (limited to 'ndisasm.c')
-rw-r--r-- | ndisasm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -259,7 +259,7 @@ int main(int argc, char **argv) nextsync = next_sync(offset, &synclen); do { uint32_t to_read = buffer + sizeof(buffer) - p; - if (to_read > nextsync - offset - (p - q)) + if (nextsync && to_read > nextsync - offset - (p - q)) to_read = nextsync - offset - (p - q); if (to_read) { lenread = fread(p, 1, to_read, fp); @@ -268,7 +268,7 @@ int main(int argc, char **argv) } else lenread = 0; p += lenread; - if ((uint32_t)offset == nextsync) { + if (nextsync && (uint32_t)offset == nextsync) { if (synclen) { fprintf(stdout, "%08"PRIX32" skipping 0x%"PRIX32" bytes\n", offset, synclen); offset += synclen; |