Misc conversion fixes

This commit is contained in:
Christian Göttsche 2020-10-15 22:35:44 +02:00 committed by cgzones
parent 1d00893110
commit af4f58d013
3 changed files with 5 additions and 5 deletions

View File

@ -107,7 +107,7 @@ bool Action_setUserOnly(const char* userName, uid_t* userId) {
*userId = user->pw_uid; *userId = user->pw_uid;
return true; return true;
} }
*userId = -1; *userId = (uid_t)-1;
return false; return false;
} }

View File

@ -109,13 +109,13 @@ void TraceScreen_updateTrace(InfoScreen* super) {
struct timeval tv; struct timeval tv;
tv.tv_sec = 0; tv.tv_usec = 500; tv.tv_sec = 0; tv.tv_usec = 500;
int ready = select(this->fd_strace+1, &fds, NULL, NULL, &tv); int ready = select(this->fd_strace+1, &fds, NULL, NULL, &tv);
int nread = 0; size_t nread = 0;
if (ready > 0 && FD_ISSET(this->fd_strace, &fds)) if (ready > 0 && FD_ISSET(this->fd_strace, &fds))
nread = fread(buffer, 1, sizeof(buffer) - 1, this->strace); nread = fread(buffer, 1, sizeof(buffer) - 1, this->strace);
if (nread && this->tracing) { if (nread && this->tracing) {
char* line = buffer; const char* line = buffer;
buffer[nread] = '\0'; buffer[nread] = '\0';
for (int i = 0; i < nread; i++) { for (size_t i = 0; i < nread; i++) {
if (buffer[i] == '\n') { if (buffer[i] == '\n') {
buffer[i] = '\0'; buffer[i] = '\0';
if (this->contLine) { if (this->contLine) {

2
htop.c
View File

@ -74,7 +74,7 @@ static CommandLineSettings parseArguments(int argc, char** argv) {
CommandLineSettings flags = { CommandLineSettings flags = {
.pidMatchList = NULL, .pidMatchList = NULL,
.commFilter = NULL, .commFilter = NULL,
.userId = -1, // -1 is guaranteed to be an invalid uid_t (see setreuid(2)) .userId = (uid_t)-1, // -1 is guaranteed to be an invalid uid_t (see setreuid(2))
.sortKey = 0, .sortKey = 0,
.delay = -1, .delay = -1,
.useColors = true, .useColors = true,