aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2018-07-08 18:24:48 +0200
committerSebastian Pipping <sebastian@pipping.org>2018-07-08 18:28:16 +0200
commite242856e39091f99405e199fec638d8bd27c53a9 (patch)
tree2d3d0857b30a05f7200c7142c09dd2908bc9a70e
parentRelease 0.7.7.1 (diff)
downloadelogv-e242856e39091f99405e199fec638d8bd27c53a9.tar.gz
elogv-e242856e39091f99405e199fec638d8bd27c53a9.tar.bz2
elogv-e242856e39091f99405e199fec638d8bd27c53a9.zip
Fix crash for >32767 log files (fixes #10)
-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()