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

This commit is contained in:
cinap_lenrek 2016-09-14 00:18:45 +02:00
parent a0150376df
commit 7bcbef11eb
2 changed files with 3 additions and 2 deletions

View file

@ -544,7 +544,7 @@ __flagfmt(Fmt *f)
break; break;
case 'z': case 'z':
f->flags |= FmtLong; f->flags |= FmtLong;
if(sizeof(void*) == sizeof(vlong)) if(sizeof(size_t) == sizeof(vlong))
f->flags |= FmtVLong; f->flags |= FmtVLong;
break; break;
} }

View file

@ -12,6 +12,7 @@
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <stdarg.h>
#include <stddef.h>
#include <utf.h> #include <utf.h>
#include "fmt.h" #include "fmt.h"
@ -36,6 +37,6 @@ main(int argc, char *argv[])
print("%d\n", 23); print("%d\n", 23);
print("%i\n", 23); print("%i\n", 23);
print("%p\n", argv); print("%p\n", argv);
print("%zd\n", &argv[1] - &argv[0]); print("%zd\n", (size_t)-1);
return 0; return 0;
} }