From 91c34bffe746c6d5b4c5d24b948402a56625d87d Mon Sep 17 00:00:00 2001 From: jhb Date: Mon, 26 Feb 2001 20:32:18 +0000 Subject: When ensuring the destination buffer is truncated for a string obtained from a BIF, use the size of the destinatino buffer, not the length of the string to determine where to put the nul char. As a side effect, the old code would truncate the string by one character while it was possibly overflowing the buffer. --- sys/dev/acpica/acpi_cmbat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/dev/acpica/acpi_cmbat.c b/sys/dev/acpica/acpi_cmbat.c index a0c0feb..4c26305 100644 --- a/sys/dev/acpica/acpi_cmbat.c +++ b/sys/dev/acpica/acpi_cmbat.c @@ -93,7 +93,7 @@ static int acpi_cmbat_units = 0; default: \ goto label; \ } \ - dest[length-1] = '\0'; \ + dest[sizeof(dest)-1] = '\0'; \ } while(0) static void -- cgit v1.1