git: 9front

Download patch

ref: 5cfe317b9eaa47708c7df78e5db2529278f3365f
parent: de9f22c28884d227af2725f72be540edb672c847
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Sep 13 20:18:45 EDT 2016

ape: fix format clash, %z is for size_t (which is a long currently), not pointer sized

--- a/sys/src/ape/lib/fmt/dofmt.c
+++ b/sys/src/ape/lib/fmt/dofmt.c
@@ -544,7 +544,7 @@
 		break;
 	case 'z':
 		f->flags |= FmtLong;
-		if(sizeof(void*) == sizeof(vlong))
+		if(sizeof(size_t) == sizeof(vlong))
 			f->flags |= FmtVLong;
 		break;
 	}
--- a/sys/src/ape/lib/fmt/test.c
+++ b/sys/src/ape/lib/fmt/test.c
@@ -12,6 +12,7 @@
  * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
  */
 #include <stdarg.h>
+#include <stddef.h>
 #include <utf.h>
 #include "fmt.h"
 
@@ -36,6 +37,6 @@
 	print("%d\n", 23);
 	print("%i\n", 23);
 	print("%p\n", argv);
-	print("%zd\n", &argv[1] - &argv[0]);
+	print("%zd\n", (size_t)-1);
 	return 0;
 }
--