shurizzle / rust-smc

macOS SMC implementation.
4 stars 5 forks source link

Panic at 'attempted to zero-initialize type `SMCParam`, which is invalid' #2

Closed misos1 closed 3 years ago

misos1 commented 3 years ago

rustc 1.49.0 (e1884a8e3 2020-12-29)

thread 'main' panicked at 'attempted to zero-initialize type `SMCParam`, which is invalid'

   2: core::panicking::panic
             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/panicking.rs:50:5
   3: core::mem::zeroed
             at .rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/mem/mod.rs:623:9
   4: smc::SMCRepr::key_information
             at .cargo/registry/src/github.com-1ecc6299db9ec823/smc-0.2.1/src/lib.rs:321:44
shurizzle commented 3 years ago

Fixed in version 0.2.2.

Thanks for reporting!

misos1 commented 3 years ago

Well fixed! Also it would be nice if it would be possible to read and write any SMC key for example to write BCLM ("Battery Charge Level Max"). (Also there is a typo in cargo.toml keywords.)