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
@ -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…
x
Reference in New Issue
Block a user