Hi tech,

there is an unnecessary typecast in xmalloc.c of rcs.

fritjof


Index: xmalloc.c
===================================================================
RCS file: /cvs/src/usr.bin/rcs/xmalloc.c,v
retrieving revision 1.4
diff -u -p -r1.4 xmalloc.c
--- xmalloc.c   7 Jun 2009 08:39:13 -0000       1.4
+++ xmalloc.c   20 Jun 2014 10:21:37 -0000
@@ -32,8 +32,8 @@ xmalloc(size_t size)
        ptr = malloc(size);
        if (ptr == NULL)
                errx(1,
-                   "xmalloc: out of memory (allocating %lu bytes)",
-                   (u_long) size);
+                   "xmalloc: out of memory (allocating %zu bytes)",
+                   size);
        return ptr;
 }
 
@@ -48,8 +48,8 @@ xcalloc(size_t nmemb, size_t size)
                errx(1, "xcalloc: nmemb * size > SIZE_MAX");
        ptr = calloc(nmemb, size);
        if (ptr == NULL)
-               errx(1, "xcalloc: out of memory (allocating %lu bytes)",
-                   (u_long)(size * nmemb));
+               errx(1, "xcalloc: out of memory (allocating %zu bytes)",
+                   (size * nmemb));
        return ptr;
 }
 
@@ -68,8 +68,8 @@ xrealloc(void *ptr, size_t nmemb, size_t
        else
                new_ptr = realloc(ptr, new_size);
        if (new_ptr == NULL)
-               errx(1, "xrealloc: out of memory (new_size %lu bytes)",
-                   (u_long) new_size);
+               errx(1, "xrealloc: out of memory (new_size %zu bytes)",
+                   new_size);
        return new_ptr;
 }
 

Reply via email to