diff options
author | Bardur Arantsson <bardur@scientician.net> | 2010-08-01 09:39:25 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2010-08-01 10:28:32 +0200 |
commit | eb4d68c77faaac1a60d6dc75511b6b7d7101b089 (patch) | |
tree | b40bb1083b1e80853d7d7e84f9643cbb8682130a /src/util.c | |
parent | 5b231d5d603b897aa16835f6f70675c982874c3f (diff) |
Fix display issues with extremely wide terminals.
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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 */ |