mirror of
https://github.com/netwide-assembler/nasm
synced 2026-08-26 16:23:04 -04:00
omfdump.c: add updates from Bernd Böckmann
Bernd Böcknann has been maintaining a fork of this tool on github:
https://github.com/boeckmann/omfdump
Sync with his latest version. In the future it might be possible to
drop this tool from the NASM distribution entirely.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
parent
ed8864e342
commit
6015afc6d7
1 changed files with 7 additions and 6 deletions
|
|
@ -92,6 +92,7 @@ static void *nulldie(void *ptr)
|
|||
fprintf(stderr, "%s: memory allocation error\n", progname);
|
||||
exit(1);
|
||||
abort(); /* This should never happen */
|
||||
return NULL; /* make compiler happy */
|
||||
}
|
||||
|
||||
static void *xmalloc(size_t size)
|
||||
|
|
@ -110,7 +111,7 @@ static void *expand_buffer(void *buf, size_t *bufsizep, size_t datasize,
|
|||
{
|
||||
size_t bufsize = *bufsizep;
|
||||
|
||||
if (likely(bufsize < datasize))
|
||||
if (likely(bufsize > datasize))
|
||||
return buf;
|
||||
|
||||
if (bufsize < BUFSIZ)
|
||||
|
|
@ -159,12 +160,12 @@ static void hexdump_data(unsigned int offset, const uint8_t *data,
|
|||
printf(" %04x: ", i + offset);
|
||||
for (j = 0; j < 16; j++) {
|
||||
char sep = (j == 7) ? '-' : ' ';
|
||||
if (i + j < field)
|
||||
printf("%02x%c", data[i + j], sep);
|
||||
else if (i + j < n)
|
||||
printf("xx%c", sep); /* Beyond end of... */
|
||||
else
|
||||
if (i + j >= n)
|
||||
printf(" "); /* No separator */
|
||||
else if (i + j < field)
|
||||
printf("%02x%c", data[i + j], sep);
|
||||
else
|
||||
printf("xx%c", sep); /* Beyond end of... */
|
||||
}
|
||||
printf(" : ");
|
||||
for (j = 0; j < 16; j++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue