From fea1cbf7484df23a6fe0b62ccd1de271bc1f931a Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Fri, 26 Feb 2016 11:10:24 +0100 Subject: misc: never cast void* from malloc(3) and friends Such cast could hide serious compiler warnings in case we are missing includes (e.g. or "xalloc.h"). See http://stackoverflow.com/questions/605845/do-i-cast-the-result-of-malloc Signed-off-by: Ruediger Meier --- term-utils/agetty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'term-utils/agetty.c') diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 55a00e125..1df1bc861 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -1970,7 +1970,7 @@ static char *get_logname(struct options *op, struct termios *tp, struct chardata if (len < 0) log_err(_("%s: invalid character conversion for login name"), op->tty); - wcs = (wchar_t *) malloc((len + 1) * sizeof(wchar_t)); + wcs = malloc((len + 1) * sizeof(wchar_t)); if (!wcs) log_err(_("failed to allocate memory: %m")); -- cgit v1.2.3-55-g7522