Opened 15 years ago
Closed 15 years ago
#4305 closed bug (fixed)
PowerStatus may divide with 0 and crash Deskbar
Reported by: | tqh | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Applications/PowerStatus | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
PowerStatus reads a value without checking if it zero before doing a divide, which can crash Deskbar (and did so with the default ACPI code here).
Patch included.
Attachments (1)
Change History (6)
by , 15 years ago
Attachment: | PowerStatus.patch added |
---|
comment:1 by , 15 years ago
The idea is that we only update fPercent if we have full_capacity value other than 0. Otherwise we keep the old value, which may be -1 (never set) or the last known value.
comment:2 by , 15 years ago
So far so good, but why setting the color to white? If there is no value, the battery should look the same way as if it isn't there.
comment:3 by , 15 years ago
Component: | Applications → Applications/PowerStatus |
---|
comment:4 by , 15 years ago
I wanted to see when it hadn't gotten valid data, that it was in 'state unknown'. The color or if it should be there I leave to you, but it is at least useful for me atm.
Fixed style on if(