This commit is contained in:
anomen
2017-01-01 20:49:38 +01:00
parent 5e2c35700b
commit 2d829675a8
2 changed files with 1 additions and 18 deletions

View File

@@ -121,23 +121,6 @@ std::string uid2username(uid_t uid) {
return std::string(pwd->pw_name);
}
/**
* Render the provided text at the specified location, truncating if the length
* of the text exceeds a maximum. If the
* text must be truncated, the string ".." will be rendered, followed by max_len
* - 2 characters of the provided text.
*/
static void mvaddstr_truncate_leading(int row, int col, const char *str,
std::size_t str_len,
std::size_t max_len) {
if (str_len < max_len) {
mvaddstr(row, col, str);
} else {
mvaddstr(row, col, "..");
addnstr(str + 2, max_len - 2);
}
}
/**
* Render the provided text at the specified location, truncating if the length
* of the text exceeds a maximum. If the

View File

@@ -126,7 +126,7 @@ std::string getcmdline(pid_t pid) {
std::string cmdline = read_file(filename);
// join parameters, keep prgname separate, don't overwrite trailing null
for (int idx = 0; idx < (cmdline.length() - 1); idx++) {
for (size_t idx = 0; idx < (cmdline.length() - 1); idx++) {
if (cmdline[idx] == 0x00) {
if (replace_null) {
cmdline[idx] = ' ';