mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-24 07:46:41 +00:00
patch: Fix substring end parameter for accurate CPU ID
Signed-off-by: Vipul Gupta (@vipulgupta2048) <vipul@balena.io>
This commit is contained in:
parent
14efec2c7d
commit
d058f43feb
@ -69,7 +69,7 @@ export async function getCpuId(): Promise<string | undefined> {
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user