mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-21 03:14:19 +08:00
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.
This commit is contained in:
parent
2a15e69ebe
commit
49da468830
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user