diff options
author | 2018-07-08 18:24:48 +0200 | |
---|---|---|
committer | 2018-07-08 18:28:16 +0200 | |
commit | e242856e39091f99405e199fec638d8bd27c53a9 (patch) | |
tree | 2d3d0857b30a05f7200c7142c09dd2908bc9a70e | |
parent | Release 0.7.7.1 (diff) | |
download | elogv-e242856e39091f99405e199fec638d8bd27c53a9.tar.gz elogv-e242856e39091f99405e199fec638d8bd27c53a9.tar.bz2 elogv-e242856e39091f99405e199fec638d8bd27c53a9.zip |
Fix crash for >32767 log files (fixes #10)
-rwxr-xr-x | elogv | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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() |