aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xelogv6
1 files changed, 6 insertions, 0 deletions
diff --git a/elogv b/elogv
index e579e01..3b174c5 100755
--- a/elogv
+++ b/elogv
@@ -498,6 +498,12 @@ class ElogViewer:
else:
self.packages.sort(key=self.get_packages_key, reverse=self.sort_method[1])
+ # Curses' newpad fails for nlines >32767 so we truncate the list
+ # of log files to not exceed that limit (issue #10)
+ MAX_ENTRIES = 2 ** 15 - 1
+ if len(self.packages) > MAX_ENTRIES:
+ self.packages = self.packages[:MAX_ENTRIES]
+
self.file_pad = curses.newpad(len(self.packages),self.width)
self.file_pad.erase()