summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-11-14 23:35:16 +0000
committerMiles Bader <miles@gnu.org>1995-11-14 23:35:16 +0000
commitd5c1a156fae5fc334f009f4a9b8d3cb06e3b9efe (patch)
tree99439ff87890e60045f011c18a3b72aae0f5513e /utils
parent6b5139be2a99e143e61d0f86cd837966f01214e1 (diff)
(main): Grow TTY_NAMES properly even when it's empty.
Diffstat (limited to 'utils')
-rw-r--r--utils/ps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/ps.c b/utils/ps.c
index 344e6863..dcb0d7aa 100644
--- a/utils/ps.c
+++ b/utils/ps.c
@@ -434,7 +434,7 @@ main(int argc, char *argv[])
{
if (tty_names_alloced == num_tty_names)
{
- tty_names_alloced *= 2;
+ tty_names_alloced += tty_names_alloced + 1;
tty_names = realloc(tty_names, tty_names_alloced * sizeof(int));
if (tty_names == NULL)
error(8, ENOMEM, "Can't allocate tty_name list");