Two printf format fixes

Martti Kuparinen <>
Tue Mar 2 08:32:10 CET 2010


Hi,

I'm resending this as inline patch (instead of an attachment)...

This patch fixes these two warnings in R13B04 on my 64-bit Ubuntu 9.10 with GCC 4.4.1

esock_utils.c:38: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘size_t’
esock_utils.c:50: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘size_t’ 



--- a/lib/ssl/c_src/esock_utils.c
+++ b/lib/ssl/c_src/esock_utils.c
@@ -35,7 +35,7 @@ void *esock_malloc(size_t size)
 
     p = malloc(size);
     if (!p) {
-	fprintf(stderr, "esock_malloc: cannot alloc %d bytes\n", size);
+	fprintf(stderr, "esock_malloc: cannot alloc %zu bytes\n", size);
 	exit(EXIT_FAILURE);
     }
     return p;
@@ -47,7 +47,7 @@ void *esock_realloc(void *p, size_t size)
 
     np = realloc(p, size);
     if (!np) {
-	fprintf(stderr, "esock_realloc: cannot realloc %d bytes\n", size);
+	fprintf(stderr, "esock_realloc: cannot realloc %zu bytes\n", size);
 	exit(EXIT_FAILURE);
     }
     return np;


More information about the erlang-patches mailing list