[bugfix] untested bugfix that occured when passing the lenght of the boottime value

This commit is contained in:
Abdellah El Morabit 2025-10-12 23:20:25 +02:00
parent 99ace57358
commit b5819824ee

View File

@ -294,10 +294,11 @@ void device_hostname(){
void device_up_time(){ void device_up_time(){
struct timeval boottime; // struct timeval boottime;
unsigned long boottime ;
unsigned long len = sizeof(boottime); unsigned long len = sizeof(boottime);
if (sysctlbyname("kern.boottime", &boottime, NULL, NULL, NULL) == -1){ if (sysctlbyname("kern.boottime", &boottime, NULL, NULL, len) == -1){
perror("sysctl error"); perror("sysctl error");
return; return;
} }
@ -319,7 +320,7 @@ void device_model(){
return; return;
} }
_device.hostname = hostname; _device.name = model_name;
return; return;
} }