scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 6c733bdb6f445154fd98ef04eb1a30afc942964a
parent 293a61bd28b7ee50aa0adee5c53054bd9f85df8e
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 28 Nov 2017 20:35:39 +0100

[objdump] Delay print name

Don't print anything until be sure it is a valid object.

Diffstat:
Mobjdump/main.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/objdump/main.c b/objdump/main.c @@ -209,7 +209,6 @@ dump(char *fname) FILE *fp; struct myrohdr hdr; - puts(fname); if ((fp = fopen(fname, "rb")) == NULL) goto wrong_file; if (rdmyrohdr(fp, &hdr) < 0) @@ -220,6 +219,7 @@ dump(char *fname) fname); goto close_file; } + puts(fname); if (hdr.strsize > SIZE_MAX) { fprintf(stderr, "objdump: %s: overflow in header\n",