shithub: scc

Download patch

ref: cf963771888825f268769131531b7c5f51b8fb04
parent: 714e6c85055b439081e40823009a52bea7d98579
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Oct 29 17:53:14 EDT 2021

size: Remove spureous strerror() output

Readobj() returns error in cases where errno is not set,
so using strerror() can generate strange messages.

--- a/src/cmd/size.c
+++ b/src/cmd/size.c
@@ -47,12 +47,12 @@
 	Section sec;
 
 	if ((obj = newobj(type)) == NULL) {
-		error(strerror(errno));
+		error("failed allocation");
 		return;
 	}
 
 	if (readobj(obj, fp) < 0) {
-		error(strerror(errno));
+		error("invalid file");
 		goto err;
 	}