Commit 1e124da0 authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

coverity fixes

parent dd86b9b6
......@@ -313,7 +313,7 @@ static void ProcessList_remove(ProcessList* this, Process* p) {
unsigned int pid = p->pid;
int index = Vector_indexOf(this->processes, p, Process_pidCompare);
assert(index != -1);
Vector_remove(this->processes, index);
if (index >= 0) Vector_remove(this->processes, index);
assert(Hashtable_get(this->processTable, pid) == NULL); (void)pid;
assert(Hashtable_count(this->processTable) == Vector_count(this->processes));
}
......@@ -730,7 +730,7 @@ static bool ProcessList_processEntries(ProcessList* this, char* dirname, Process
void ProcessList_scan(ProcessList* this) {
unsigned long long int usertime, nicetime, systemtime, systemalltime, idlealltime, idletime, totaltime;
unsigned long long int swapFree;
unsigned long long int swapFree = 0;
FILE* status;
char buffer[128];
......
......@@ -19,7 +19,7 @@ int UptimeMeter_attributes[] = {
};
static void UptimeMeter_setValues(Meter* this, char* buffer, int len) {
double uptime;
double uptime = 0;
FILE* fd = fopen(PROCDIR "/uptime", "r");
fscanf(fd, "%lf", &uptime);
fclose(fd);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment