diff options
author | Jim Meyering <jim@meyering.net> | 2004-04-18 15:02:49 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2004-04-18 15:02:49 +0000 |
commit | 6bb27087a1e67b297ab1074b614782f073adb2b6 (patch) | |
tree | a18c3bb4b2986765a9161bb7df5e68b62ec757ef /src/who.c | |
parent | 3e7d83141218fdf06a26abd9420d88bf1b0ea1bf (diff) | |
download | coreutils-6bb27087a1e67b297ab1074b614782f073adb2b6.tar.xz |
(print_user): Use xrealloc here, rather than unchecked realloc.
Remove anachronistic casts.
Diffstat (limited to 'src/who.c')
-rw-r--r-- | src/who.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -390,7 +390,7 @@ print_user (const STRUCT_UTMP *utmp_ent) if (hostlen < strlen (host) + strlen (display) + 4) { hostlen = strlen (host) + strlen (display) + 4; - hoststr = (char *) realloc (hoststr, hostlen); + hoststr = xrealloc (hoststr, hostlen); } sprintf (hoststr, "(%s:%s)", host, display); } @@ -399,7 +399,7 @@ print_user (const STRUCT_UTMP *utmp_ent) if (hostlen < strlen (host) + 3) { hostlen = strlen (host) + 3; - hoststr = (char *) realloc (hoststr, hostlen); + hoststr = xrealloc (hoststr, hostlen); } sprintf (hoststr, "(%s)", host); } @@ -409,7 +409,7 @@ print_user (const STRUCT_UTMP *utmp_ent) if (hostlen < 1) { hostlen = 1; - hoststr = (char *) realloc (hoststr, hostlen); + hoststr = xrealloc (hoststr, hostlen); } stpcpy (hoststr, ""); } |