wmbattery: avoid truncating ACPI file paths
commitd9ae826d626d40e27605e6b222a24e96bcf26458
authorJeremy Sowden <jeremy@azazel.net>
Fri, 3 Jun 2022 16:46:17 +0000 (3 17:46 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Fri, 3 Jun 2022 17:17:43 +0000 (3 18:17 +0100)
tree22855807d98af80f21cd3076a568d0a58a7a660b
parent54369d5360f8627f2d375176a59956fd6775f565
wmbattery: avoid truncating ACPI file paths

Instead of writing the static `SYSFS_PATH` string to a buffer, and
passing the buffer to `opendir`, remove the buffer and pass the static
string directly.

Instead of using a fixed size for the ACPI file path buffer, size it
based on the sizes of the arguments that snprintf will write to it.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
wmbattery/acpi.c