diff --git a/pmap.c b/pmap.c index 4fb7a61c..742fcea9 100644 --- a/pmap.c +++ b/pmap.c @@ -661,7 +661,7 @@ int main(int argc, char **argv) x_option && (d_option || X_option)) xerrx(EXIT_FAILURE, _("options -d, -x, -X are mutually exclusive")); - pidlist = xmalloc(sizeof(unsigned) * argc); + pidlist = xmalloc(sizeof(unsigned long) * argc); while (*argv) { char *walk = *argv++; diff --git a/proc/alloc.c b/proc/alloc.c index 671d7523..94af47f7 100644 --- a/proc/alloc.c +++ b/proc/alloc.c @@ -50,14 +50,14 @@ void *xcalloc(unsigned int size) { return p; } -void *xmalloc(unsigned int size) { +void *xmalloc(size_t size) { void *p; if (size == 0) ++size; p = malloc(size); if (!p) { - xalloc_err_handler("%s failed to allocate %u bytes of memory", __func__, size); + xalloc_err_handler("%s failed to allocate %zu bytes of memory", __func__, size); exit(EXIT_FAILURE); } return(p); diff --git a/proc/alloc.h b/proc/alloc.h index 82b53592..19c91d78 100644 --- a/proc/alloc.h +++ b/proc/alloc.h @@ -9,7 +9,7 @@ EXTERN_C_BEGIN extern message_fn xalloc_err_handler; extern void *xcalloc(unsigned int size) MALLOC; -extern void *xmalloc(unsigned int size) MALLOC; +extern void *xmalloc(size_t size) MALLOC; extern void *xrealloc(void *oldp, unsigned int size) MALLOC; extern char *xstrdup(const char *str) MALLOC;