diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2012-05-27 14:18:35 +0200 |
---|---|---|
committer | Andreas Schwab <schwab@linux-m68k.org> | 2012-05-27 14:18:35 +0200 |
commit | f3dd73121c15514280f6ddd467b00663945b6648 (patch) | |
tree | b17b9dca8fb110b3e855259cdd56b84c7d501c77 /src/unexmacosx.c | |
parent | cd37650917a996c2bda3fdc1aa2955b9cace964f (diff) | |
download | emacs-f3dd73121c15514280f6ddd467b00663945b6648.tar.gz |
* unexmacosx.c (copy_data_segment): Truncate after 16 characters
when referring to sectname field in printf format.
Diffstat (limited to 'src/unexmacosx.c')
-rw-r--r-- | src/unexmacosx.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/unexmacosx.c b/src/unexmacosx.c index 2e77d3e17bc..a61bbd8eb86 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c @@ -809,9 +809,9 @@ copy_data_segment (struct load_command *lc) { sectp->flags = S_REGULAR; if (!unexec_write (sectp->offset, (void *) sectp->addr, sectp->size)) - unexec_error ("cannot write section %s", sectp->sectname); + unexec_error ("cannot write section %.16s", sectp->sectname); if (!unexec_write (header_offset, sectp, sizeof (struct section))) - unexec_error ("cannot write section %s's header", sectp->sectname); + unexec_error ("cannot write section %.16s's header", sectp->sectname); } else if (strncmp (sectp->sectname, SECT_BSS, 16) == 0) { @@ -829,15 +829,15 @@ copy_data_segment (struct load_command *lc) my_size = (unsigned long)my_endbss_static - sectp->addr; if (!(sectp->addr <= (unsigned long)my_endbss_static && my_size <= sectp->size)) - unexec_error ("my_endbss_static is not in section %s", + unexec_error ("my_endbss_static is not in section %.16s", sectp->sectname); if (!unexec_write (sectp->offset, (void *) sectp->addr, my_size)) - unexec_error ("cannot write section %s", sectp->sectname); + unexec_error ("cannot write section %.16s", sectp->sectname); if (!unexec_write_zero (sectp->offset + my_size, sectp->size - my_size)) - unexec_error ("cannot write section %s", sectp->sectname); + unexec_error ("cannot write section %.16s", sectp->sectname); if (!unexec_write (header_offset, sectp, sizeof (struct section))) - unexec_error ("cannot write section %s's header", sectp->sectname); + unexec_error ("cannot write section %.16s's header", sectp->sectname); } else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0 || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0 @@ -851,12 +851,13 @@ copy_data_segment (struct load_command *lc) || strncmp (sectp->sectname, "__objc_", 7) == 0) { if (!unexec_copy (sectp->offset, old_file_offset, sectp->size)) - unexec_error ("cannot copy section %s", sectp->sectname); + unexec_error ("cannot copy section %.16s", sectp->sectname); if (!unexec_write (header_offset, sectp, sizeof (struct section))) - unexec_error ("cannot write section %s's header", sectp->sectname); + unexec_error ("cannot write section %.16s's header", sectp->sectname); } else - unexec_error ("unrecognized section name in __DATA segment"); + unexec_error ("unrecognized section %.16s in __DATA segment", + sectp->sectname); printf (" section %-16.16s at %#8lx - %#8lx (sz: %#8lx)\n", sectp->sectname, (long) (sectp->offset), |