On the internet the usage of b and B for bits or bytes is inconsistent.
Lowercase b seems to be used for either, and upperace B is more often
used to mean bytes but usege for bits also exists.
I am not aware of any standard that would mandate one or other use.
Consequently, spelling out the whole word in the output or adding
explanation in documentation is the only way to make sure the output is
interpreted correctly.
To save space on small screens only alter documentation and the bytes
label without prefixes/suffixes.
While at it change uppercase K to lowercase k to correctly spell the
kilo- prefix.
Fixes: #261
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Showing the cursor while running (especially on terminals where it
blinks) is a bit visually distracting, and doesn't serve much purpose;
make it invisible in init_ui() and restore the original state in
exit_ui().
To address:
https://github.com/raboof/nethogs/issues/225
add the `-std=c++14` flag when building the application.
This then compiles properly with the Apple version of the Clang
compiler:
Apple clang version 11.0.0 (clang-1100.0.33.17)
Additionally, this removed some warning noise regarding C++11
extensions used without the appropriate `-std=c++11` (or greater)
flag:
./process.h:38:26: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
connection.cpp:107:3: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
connection.cpp:108:8: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
connection.cpp:162:3: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
connection.cpp:187:3: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
Keeping a sorted multi-set allows faster search by source /
source+destination address.
Fixes O(n^2) complexity when handling a lot of connections (now it's
O(n log n)).
Now, the user can decide to show only the program name, instead of the
full program path. It is useful, when you have a very long hierarchy of
directories, which, with the full path name, the user might not see the
program name.
When compiling with [-Werror=format-security] in Debian packaging occurs this error:
```
cui.cpp: In function ‘void show_ncurses(Line**, int)’:
cui.cpp:377:73: error: format not a string literal and no format arguments [-Werror=format-security]
377 | mvprintw(3 + 1 + i, cols - COLUMN_WIDTH_UNIT, desc_view_mode[viewMode]);
| ^
cui.cpp:379:29: warning: zero-length gnu_printf format string [-Wformat-zero-length]
379 | mvprintw(totalrow + 1, 0, "");
| ^~
```
This patch solve the problem.
[]'s
kretcheu
* removes the exit calls in inode2prog which was called if an error
occured while reading /proc/<pid>/cmdline file. Instead an Exception is
thrown with an error message
* adds catch block for all exception while reading cmdline file
Calling nethogsmonitor_loop, canceling it with nethogsmonitor_breakloop
and then calling it again will lead to a Segmentation fault.
This is due to handles not getting reset to NULL which leads to a
invalid list since the old list will be reused by
new handle(newhandle, current_dev->name, handles);
in nethogsmonitor_init(). If handles is reset to NULL it will also
remove the only reference to the old list, hence it should be freed to
avoid memory leaks.
This change will reset handles to NULL after freeing all handles when
nethogsmonitor_clean_up is called.