mirror of https://github.com/xzeldon/htop.git
Increae the size of sysfs power supply path buffers
Resolves https://github.com/htop-dev/htop/issues/15
This commit is contained in:
parent
b5e6952cc6
commit
b992d52bcf
|
@ -107,7 +107,7 @@ static ACPresence procAcpiCheck() {
|
||||||
if (entryName[0] != 'A')
|
if (entryName[0] != 'A')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
char statePath[50];
|
char statePath[256];
|
||||||
xSnprintf((char *) statePath, sizeof statePath, "%s/%s/state", power_supplyPath, entryName);
|
xSnprintf((char *) statePath, sizeof statePath, "%s/%s/state", power_supplyPath, entryName);
|
||||||
FILE* file = fopen(statePath, "r");
|
FILE* file = fopen(statePath, "r");
|
||||||
if (!file) {
|
if (!file) {
|
||||||
|
@ -191,7 +191,7 @@ static void Battery_getSysData(double* level, ACPresence* isOnAC) {
|
||||||
if (!dirEntry)
|
if (!dirEntry)
|
||||||
break;
|
break;
|
||||||
char* entryName = (char *) dirEntry->d_name;
|
char* entryName = (char *) dirEntry->d_name;
|
||||||
const char filePath[50];
|
const char filePath[256];
|
||||||
|
|
||||||
xSnprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/type", entryName);
|
xSnprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/type", entryName);
|
||||||
int fd1 = open(filePath, O_RDONLY);
|
int fd1 = open(filePath, O_RDONLY);
|
||||||
|
|
Loading…
Reference in New Issue