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.
This commit is contained in:
jhb 2001-02-26 20:32:18 +00:00
parent be8339b765
commit 91c34bffe7

View File

@ -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