(print_user): Use xrealloc here, rather than unchecked realloc.
authorJim Meyering <jim@meyering.net>
Sun, 18 Apr 2004 15:02:49 +0000 (15:02 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 18 Apr 2004 15:02:49 +0000 (15:02 +0000)
Remove anachronistic casts.

src/who.c

index 184a8cb..1336510 100644 (file)
--- a/src/who.c
+++ b/src/who.c
@@ -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, "");
     }