shithub: mcfs

Download patch

ref: d0b012b3e6c785e9789435aef04e31ec8348723c
parent: b3593d1790eab158497d7f1a3cbfcebcbac61200
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Fri Feb 5 07:26:10 EST 2021

mkvdump: fix up fmt verbs

--- a/extra/mkvdump.c
+++ b/extra/mkvdump.c
@@ -55,9 +55,11 @@
 	for(;;){
 		off = Boffset(&in);
 		if((n = ebmlel(&in, 0x7fffffffffffffffLL, &s, &sz)) < 0){
-			werrstr("invalid ebml: %r at %#zx (size %zd)", off, sz);
+			werrstr("invalid ebml: %r at %#llx (size %lld)", off, sz);
 			goto err;
 		}
+		if(s.type < 0)
+			continue;
 		if(n == 0) /* eof */
 			break;
 		while(sti > 0 && off >= stack[sti-1])
@@ -67,12 +69,14 @@
 				Bputc(&out, '\t');
 			Bprint(&out, "%s ", s.name);
 			if(debug)
-				Bprint(&out, " (%zd bytes) ", sz);
+				Bprint(&out, " (id %#llx) ", s.id);
 			if(s.type == Emaster && sti < nelem(stack))
 				stack[sti++] = off+n+sz;
 		}else{
 			Bprint(&out, "%#llx ", s.id);
 		}
+		if(debug)
+			Bprint(&out, "(%lld bytes) ", sz);
 
 		switch(s.type){
 		case Ebinary:
@@ -97,7 +101,7 @@
 				werrstr("binary: %r");
 				goto err;
 			}
-			Bprint(&out, "[%.*H%s] (%zd bytes)", n, b, sz > n ? "..." : "", sz);
+			Bprint(&out, "[%.*H%s] (%lld bytes)", n, b, sz > n ? "..." : "", sz);
 			sz -= n;
 			break;
 		case Efloat: