| commit | 2b5c1b4b133a97a46354142aa8ab0d9e79bc70a4 | [log] [download] |
|---|---|---|
| author | Tomasz Kramkowski <tk@the-tk.com> | Thu Dec 29 19:42:41 2016 +0100 |
| committer | Tomasz Kramkowski <tk@the-tk.com> | Thu Dec 29 19:42:41 2016 +0100 |
| tree | 208946c62eff13e9e6654a146cf8ff38ea7796b1 | |
| parent | 8af4d9f453ffa2209e486418811f7652822951c6 [diff] |
Replace all uses of sprintf with snprintf In all the cases where sprintf was being used within htop, snprintf could have been used. This patch replaces all uses of sprintf with snprintf which makes sure that if a buffer is too small to hold the resulting string, the string is simply cut short instead of causing a buffer overflow which leads to undefined behaviour. `sizeof(variable)` was used in these cases, as opposed to `sizeof variable` which is my personal preference because `sizeof(variable)` was already used in one way or another in other parts of the code.
by Hisham Muhammad hisham@gobolinux.org (2004 - 2016)
This is htop, an interactive process viewer. It requires ncurses. It is developed primarily on Linux, but we also have code for running under FreeBSD and Mac OS X (help and testing are wanted for these platforms!)
This software has evolved considerably over the years, and is reasonably complete, but there is always room for improvement.
htop and classic tophtop you can scroll the list vertically and horizontally to see all processes and full command lines.top you are subject to a delay for each unassigned key you press (especially annoying when multi-key escape sequences are triggered by accident).htop starts faster (top seems to collect data for a while before displaying anything).htop you don't need to type the process number to kill a process, in top you do.htop you don't need to type the process number or the priority value to renice a process, in top you do.htop you can kill multiple processes at once.top is older, hence, more tested.This program is distributed as a standard autotools-based package. See the INSTALL file for detailed instructions.
When compiling from a release tarball, run:
./configure && make
For compiling sources downloaded from the Git repository, run:
./autogen.sh && ./configure && make
By default make install will install into /usr/local, for changing the path use ./configure --prefix=/some/path.
See the manual page (man htop) or the on-line help (‘F1’ or ‘h’ inside htop) for a list of supported key commands.
If not all keys work check your curses configuration.
GNU General Public License, version 2 (GPL-2.0)