Check the column title is not empty before using it
commit529a74a28be43c04840d937c87a5ee3b81133852
authorPaul Wise <pabs3@bonedaddy.net>
Thu, 4 Aug 2016 10:24:46 +0000 (4 18:24 +0800)
committerPaul Wise <pabs3@bonedaddy.net>
Thu, 4 Aug 2016 10:24:46 +0000 (4 18:24 +0800)
treee8609d28c6f7046029e3099052434ff76ed12376
parent16a30ece6ab4eaa9ca5d056ada94673265195e27
Check the column title is not empty before using it

Fixes crash with terminals that don't fit all titles.

Traceback (most recent call last):
  File "./iotop.py", line 12, in <module>
    main()
  File "./iotop/ui.py", line 669, in main
    main_loop()
  File "./iotop/ui.py", line 659, in <lambda>
    main_loop = lambda: run_iotop(options)
  File "./iotop/ui.py", line 554, in run_iotop
    return curses.wrapper(run_iotop_window, options)
  File "/usr/lib/python3.5/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "./iotop/ui.py", line 546, in run_iotop_window
    ui.run()
  File "./iotop/ui.py", line 176, in run
    self.process_list.duration)
  File "./iotop/ui.py", line 515, in refresh_display
    self.win.addstr(len_summary, pos, title, attr)
_curses.error: addwstr() returned ERR
iotop/ui.py