git: 9front

Download patch

ref: 999f9f0de51aa2a20ab3f4c2ad67c16618305112
parent: 744e2f64d4dad4930a0f5224ce389258229d0127
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Sat Oct 15 20:46:09 EDT 2011

hgfs: format hashes in ther full length

--- a/sys/src/cmd/hgfs/hash.c
+++ b/sys/src/cmd/hgfs/hash.c
@@ -10,12 +10,11 @@
 int
 Hfmt(Fmt *f)
 {
-	uchar *p;
-
-	p = va_arg(f->args, uchar*);
-	return fmtprint(f, 
-		"%.2x%.2x%.2x%.2x%.2x%.2x",
-		p[0], p[1], p[2], p[3], p[4], p[5]);
+	uchar *p, *e;
+	for(p = va_arg(f->args, uchar*), e = p + HASHSZ; p != e; p++)
+		if(fmtprint(f, "%.2x", *p) < 0)
+			return -1;
+	return 0;
 }
 
 int
--