scc

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

commit 867b73094d71bf20b2fe72b468f264d652b379ee
parent 334c5f4eab5fc7f26aafbd0e959832cfcbd2e0a0
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 27 Nov 2017 22:33:24 +0100

[objdump] Avoid error in stderr about strings with -1

-1 is used to mark empty strings.

Diffstat:
objdump/main.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/objdump/main.c b/objdump/main.c @@ -1,6 +1,7 @@ #include <errno.h> #include <limits.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -16,7 +17,8 @@ getstring(unsigned long off) { size_t n; - + if ((int32_t) off == -1) + return ""; if (off < SIZE_MAX) { for (n = off; n < strsiz && strings[n]; ++n) ;