[MLton-commit] r4645
Matthew Fluet
MLton@mlton.org
Mon, 12 Jun 2006 09:19:43 -0700
Printf size_t values with %zu format
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/util/safe.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/util/safe.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/util/safe.h 2006-06-12 16:18:16 UTC (rev 4644)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/util/safe.h 2006-06-12 16:19:42 UTC (rev 4645)
@@ -48,17 +48,17 @@
res = fread (buf, size, count, f);
if (res != count)
- diee ("fread (_, %ld, %ld, _) failed (only read %ld).\n",
- (long)size, (long)count, (long)res);
+ diee ("fread (_, %zu, %zu, _) failed (only read %zu).\n",
+ size, count, res);
}
static inline void fwrite_safe (const void *buf, size_t size, size_t count, FILE *f) {
size_t res;
-
+
res = fwrite (buf, size, count, f);
if (res != count)
- diee ("fwrite (_, %ld, %ld, _) failed (only wrote %ld).\n",
- (long)size, (long)count, (long)res);
+ diee ("fwrite (_, %zu, %zu, _) failed (only wrote %zu).\n",
+ size, count, res);
}
static inline void *malloc_safe (size_t size) {