mirror of https://github.com/xzeldon/htop.git
Avoid crashing when using many meters (thanks to David Cho for the report)
This commit is contained in:
parent
bd0f30dcd6
commit
807df03671
|
@ -1,4 +1,9 @@
|
||||||
|
|
||||||
|
What's new in version 0.7.1
|
||||||
|
|
||||||
|
* BUGFIX: avoid crashing when using many meters
|
||||||
|
(thanks to David Cho for the report)
|
||||||
|
|
||||||
What's new in version 0.7
|
What's new in version 0.7
|
||||||
|
|
||||||
* CPU affinity configuration ('a' key)
|
* CPU affinity configuration ('a' key)
|
||||||
|
|
2
Header.c
2
Header.c
|
@ -73,6 +73,8 @@ void Header_setMode(Header* this, int i, MeterModeId mode, HeaderSide side) {
|
||||||
? this->leftMeters
|
? this->leftMeters
|
||||||
: this->rightMeters;
|
: this->rightMeters;
|
||||||
|
|
||||||
|
if (i >= Vector_size(meters))
|
||||||
|
return;
|
||||||
Meter* meter = (Meter*) Vector_get(meters, i);
|
Meter* meter = (Meter*) Vector_get(meters, i);
|
||||||
Meter_setMode(meter, mode);
|
Meter_setMode(meter, mode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,7 @@ bool Settings_read(Settings* this, char* fileName) {
|
||||||
if (fd == NULL) {
|
if (fd == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const int maxLine = 512;
|
const int maxLine = 65535;
|
||||||
char buffer[maxLine];
|
char buffer[maxLine];
|
||||||
bool readMeters = false;
|
bool readMeters = false;
|
||||||
while (!feof(fd)) {
|
while (!feof(fd)) {
|
||||||
|
|
Loading…
Reference in New Issue