Skip entries like "Processor: 0" which are common on x86, otherwise
an "ubus call system board" will just return "system: 0".
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
#include <fcntl.h>
#include <signal.h>
#include <unistd.h>
+#include <stdlib.h>
#include <libubox/uloop.h>
!strcasecmp(key, "processor") ||
!strcasecmp(key, "model name"))
{
- blobmsg_add_string(&b, "system", val + 2);
- break;
+ strtoul(val + 2, &key, 0);
+
+ if (key == (val + 2) || *key != 0)
+ {
+ blobmsg_add_string(&b, "system", val + 2);
+ break;
+ }
}
}