diff options
| author | Jim Meyering <jim@meyering.net> | 2003-04-11 10:51:56 +0000 |
|---|---|---|
| committer | Jim Meyering <jim@meyering.net> | 2003-04-11 10:51:56 +0000 |
| commit | 6c93bdeeaa8a322b76c48ffc17a2205f6c3f5271 (patch) | |
| tree | b96ee698e2bd8020d500f01cbf6d6efa743b8a69 /src/su.c | |
| parent | include xalloc.h (diff) | |
| download | coreutils-6c93bdeeaa8a322b76c48ffc17a2205f6c3f5271.tar.gz coreutils-6c93bdeeaa8a322b76c48ffc17a2205f6c3f5271.zip | |
Remove anachronistic casts of xmalloc,
xrealloc, and xcalloc return values and of xrealloc's first argument.
Diffstat (limited to 'src/su.c')
| -rw-r--r-- | src/su.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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; |
