shithub: riscv

Download patch

ref: 2d1fbbdafa37080ddaacb76ac1e4f5a413ef2dc3
parent: 641c9da369a2962a6393de4b890a563c6f02bbeb
author: cinap_lenrek <[email protected]>
date: Sun Apr 23 14:42:26 EDT 2017

upas/fs: don't abort on malformed unix header

--- a/sys/src/cmd/upas/fs/mdir.c
+++ b/sys/src/cmd/upas/fs/mdir.c
@@ -32,7 +32,7 @@
 	m->unixheader = smprint("%.*s", l, m->start);
 	s = m->start + 5;
 	if((p = strchr(s, ' ')) == nil)
-		abort();
+		return;
 	*p = 0;
 	m->unixfrom = strdup(s);
 	*p = ' ';
@@ -117,6 +117,7 @@
 	Message *m, **ll;
 	static char err[ERRMAX];
 
+	err[0] = '\0';
 	if((fd = open(mb->path, OREAD)) == -1){
 		errstr(err, sizeof err);
 		return err;