upower: Initialize variables
There are code paths in which some of these variables were used but not initialized, causing undefined behavior.pull/3028/head
parent
bd8b215416
commit
bbb69bd977
|
@ -315,12 +315,12 @@ auto UPower::update() -> void {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UpDeviceKind kind;
|
UpDeviceKind kind = UP_DEVICE_KIND_UNKNOWN;
|
||||||
UpDeviceState state;
|
UpDeviceState state = UP_DEVICE_STATE_UNKNOWN;
|
||||||
UpDeviceLevel level = UP_DEVICE_LEVEL_UNKNOWN;
|
UpDeviceLevel level = UP_DEVICE_LEVEL_UNKNOWN;
|
||||||
double percentage;
|
double percentage = 0.0;
|
||||||
gint64 time_empty;
|
gint64 time_empty = 0;
|
||||||
gint64 time_full;
|
gint64 time_full = 0;
|
||||||
gchar* icon_name{(char*)'\0'};
|
gchar* icon_name{(char*)'\0'};
|
||||||
std::string percentString{""};
|
std::string percentString{""};
|
||||||
std::string time_format{""};
|
std::string time_format{""};
|
||||||
|
|
Loading…
Reference in New Issue