From d058f43febe397857ddaa7e72a58310e89576e28 Mon Sep 17 00:00:00 2001 From: "Vipul Gupta (@vipulgupta2048)" Date: Fri, 9 Apr 2021 19:54:04 +0530 Subject: [PATCH] patch: Fix substring end parameter for accurate CPU ID Signed-off-by: Vipul Gupta (@vipulgupta2048) --- src/lib/system-info.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/system-info.ts b/src/lib/system-info.ts index 5ba9fcaa..7a56282f 100644 --- a/src/lib/system-info.ts +++ b/src/lib/system-info.ts @@ -69,7 +69,7 @@ export async function getCpuId(): Promise { try { const buffer = await fs.readFile('/proc/device-tree/serial-number'); // Remove the null byte at the end - return buffer.toString('utf-8').substr(0, buffer.length - 2); + return buffer.toString('utf-8').replace(/\0/g, ''); } catch { return undefined; }