datasone / setup_var.efi

UEFI command-line tool for read/write access of variables
Apache License 2.0
221 stars 8 forks source link

Fix: Don't include null-byte from source in strip_suffix #19

Closed fnetz closed 8 months ago

fnetz commented 8 months ago

In strip_suffix, buf included the null-byte from the source, so *buf.last_mut()? = 0 set that instead of the last actual character.

This caused setup_var.efi Setup(1):0x123 to fail with an error like "Unexpected value: 1)".

With this fix, the checks from test_functions now pass (as far as I can tell)

datasone commented 8 months ago

Thanks for the fix!