summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2010-08-01 09:39:25 +0200
committerBardur Arantsson <bardur@scientician.net>2010-08-01 10:28:32 +0200
commiteb4d68c77faaac1a60d6dc75511b6b7d7101b089 (patch)
treeb40bb1083b1e80853d7d7e84f9643cbb8682130a /src/util.c
parent5b231d5d603b897aa16835f6f70675c982874c3f (diff)
Fix display issues with extremely wide terminals.
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/util.c b/src/util.c
index d7426526..5d178780 100644
--- a/src/util.c
+++ b/src/util.c
@@ -3288,21 +3288,22 @@ bool askfor_aux(char *buf, int len)
int k = 0;
+ int wid, hgt;
+
bool done = FALSE;
/* Locate the cursor */
Term_locate(&x, &y);
-
- /* Paranoia -- check len */
- if (len < 1) len = 1;
+ /* Get terminal size */
+ Term_get_size(&wid, &hgt);
/* Paranoia -- check column */
- if ((x < 0) || (x >= 80)) x = 0;
+ if ((x < 0) || (x >= wid)) x = 0;
/* Restrict the length */
- if (x + len > 80) len = 80 - x;
+ if (x + len > wid) len = wid - x;
/* Paranoia -- Clip the default entry */