diff options
author | jmallett <jmallett@FreeBSD.org> | 2002-05-02 05:46:37 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2002-05-02 05:46:37 +0000 |
commit | 896541a042001d6b3e4ba6d71955b3b9e57bcc3b (patch) | |
tree | 4ad1731f03a9ed186218d7100cb7005257c90bc9 /bin/ps/fmt.c | |
parent | d4f20210065a9de8d9754ce2ec811f6254f0fd2c (diff) | |
download | FreeBSD-src-896541a042001d6b3e4ba6d71955b3b9e57bcc3b.zip FreeBSD-src-896541a042001d6b3e4ba6d71955b3b9e57bcc3b.tar.gz |
Don't cast incorrectly to malloc(3), and don't use errx(3) if malloc(3)
returns NULL, as malloc(3) sets errno. Use err(3).
Diffstat (limited to 'bin/ps/fmt.c')
-rw-r--r-- | bin/ps/fmt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ps/fmt.c b/bin/ps/fmt.c index fe5d6d3..21a97b9 100644 --- a/bin/ps/fmt.c +++ b/bin/ps/fmt.c @@ -72,8 +72,8 @@ shquote(char **argv) if (buf == NULL) { if ((arg_max = sysconf(_SC_ARG_MAX)) == -1) errx(1, "sysconf _SC_ARG_MAX failed"); - if ((buf = malloc((u_int)(4 * arg_max) + 1)) == NULL) - errx(1, "malloc failed"); + if ((buf = malloc((size_t)(4 * arg_max) + 1)) == NULL) + err(1, "malloc"); } if (*argv == 0) { |