summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/curses/textpad.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/curses/textpad.py b/Lib/curses/textpad.py
index 28d78dd..120c572 100644
--- a/Lib/curses/textpad.py
+++ b/Lib/curses/textpad.py
@@ -53,7 +53,7 @@ class Textbox:
last = self.maxx
while 1:
if ascii.ascii(self.win.inch(y, last)) != ascii.SP:
- last = last + 1
+ last = min(self.maxx, last+1)
break
elif last == 0:
break