summaryrefslogtreecommitdiffstats
path: root/login-utils/su.c
diff options
context:
space:
mode:
authorJim Meyering2003-04-11 12:51:56 +0200
committerJim Meyering2003-04-11 12:51:56 +0200
commit6c940aca732031e443e09ba227efcf1ce4b9cb54 (patch)
tree4d758b0f81af458535b95c5c4e143fab7fe1c3f4 /login-utils/su.c
parentChange `exit (0)' to `exit (EXIT_SUCCESS)', (diff)
downloadkernel-qcow2-util-linux-6c940aca732031e443e09ba227efcf1ce4b9cb54.tar.gz
kernel-qcow2-util-linux-6c940aca732031e443e09ba227efcf1ce4b9cb54.tar.xz
kernel-qcow2-util-linux-6c940aca732031e443e09ba227efcf1ce4b9cb54.zip
Remove anachronistic casts of xmalloc,
xrealloc, and xcalloc return values and of xrealloc's first argument.
Diffstat (limited to 'login-utils/su.c')
-rw-r--r--login-utils/su.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/login-utils/su.c b/login-utils/su.c
index ae67bf9f3..13b754add 100644
--- a/login-utils/su.c
+++ b/login-utils/su.c
@@ -1,5 +1,5 @@
/* su for GNU. Run a shell with substitute user and group IDs.
- Copyright (C) 1992-2002 Free Software Foundation, Inc.
+ Copyright (C) 1992-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -193,7 +193,7 @@ static char *
concat (const char *s1, const char *s2, const char *s3)
{
int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
- char *result = (char *) xmalloc (len1 + len2 + len3 + 1);
+ char *result = xmalloc (len1 + len2 + len3 + 1);
strcpy (result, s1);
strcpy (result + len1, s2);
@@ -310,7 +310,7 @@ modify_environment (const struct passwd *pw, const char *shell)
/* Leave TERM unchanged. Set HOME, SHELL, USER, LOGNAME, PATH.
Unset all other environment variables. */
term = getenv ("TERM");
- environ = (char **) xmalloc (2 * sizeof (char *));
+ environ = xmalloc (2 * sizeof (char *));
environ[0] = 0;
if (term)
xputenv (concat ("TERM", "=", term));
@@ -368,10 +368,10 @@ run_shell (const char *shell, const char *command, char **additional_args)
int argno = 1;
if (additional_args)
- args = (const char **) xmalloc (sizeof (char *)
+ args = xmalloc (sizeof (char *)
* (10 + elements (additional_args)));
else
- args = (const char **) xmalloc (sizeof (char *) * 10);
+ args = xmalloc (sizeof (char *) * 10);
if (simulate_login)
{
char *arg0;