shithub: scc

Download patch

ref: 5ddbf1ff9ffe88530d56abb79950c71b3e209221
parent: f9cdd3f0f5b55988d1895e58458d90622257d2c0
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Nov 27 17:33:24 EST 2017

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

-1 is used to mark empty strings.

--- 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 @@
 {
 	size_t n;
 
-	
+	if ((int32_t) off == -1)
+		return "";
 	if (off < SIZE_MAX) {
 		for (n = off; n < strsiz && strings[n]; ++n)
 			;