From b5819824ee044f9819fe9aa52802e9cd0eea71c7 Mon Sep 17 00:00:00 2001 From: Abdellah El Morabit Date: Sun, 12 Oct 2025 23:20:25 +0200 Subject: [PATCH] [bugfix] untested bugfix that occured when passing the lenght of the boottime value --- source/lib.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/lib.c b/source/lib.c index ebe810d..d65af5d 100644 --- a/source/lib.c +++ b/source/lib.c @@ -294,10 +294,11 @@ void device_hostname(){ void device_up_time(){ - struct timeval boottime; + // struct timeval boottime; + unsigned long 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"); return; } @@ -319,7 +320,7 @@ void device_model(){ return; } - _device.hostname = hostname; + _device.name = model_name; return; }