mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-21 01:03:42 +00:00
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).
This commit is contained in:
parent
2a688cec16
commit
3d674c947c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95921
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue