summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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");