svn commit: r304000 - head/usr.sbin/acpi/acpidump
Maxim Konovalov
maxim at FreeBSD.org
Fri Aug 12 08:16:36 UTC 2016
Author: maxim
Date: Fri Aug 12 08:16:35 2016
New Revision: 304000
URL: https://svnweb.freebsd.org/changeset/base/304000
Log:
o Move tmpstr varibale initialization out of assert(3) call.
This fixes acpidump(8) compiled with "WITHOUT_ASSERT_DEBUG=yes" that
removes assert(3)'s from the code.
Submitted by: Alexander Nedotsukov
Modified:
head/usr.sbin/acpi/acpidump/acpi.c
Modified: head/usr.sbin/acpi/acpidump/acpi.c
==============================================================================
--- head/usr.sbin/acpi/acpidump/acpi.c Fri Aug 12 08:08:29 2016 (r303999)
+++ head/usr.sbin/acpi/acpidump/acpi.c Fri Aug 12 08:16:35 2016 (r304000)
@@ -1494,8 +1494,8 @@ aml_disassemble(ACPI_TABLE_HEADER *rsdt,
perror("mkdtemp tmp working dir");
return;
}
- assert((size_t)snprintf(tmpstr, sizeof(tmpstr), "%s%s", wrkdir, iname)
- <= sizeof(tmpstr) - 1);
+ len = (size_t)snprintf(tmpstr, sizeof(tmpstr), "%s%s", wrkdir, iname);
+ assert(len <= sizeof(tmpstr) - 1);
fd = open(tmpstr, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
if (fd < 0) {
perror("iasl tmp file");
@@ -1527,8 +1527,8 @@ aml_disassemble(ACPI_TABLE_HEADER *rsdt,
}
/* Dump iasl's output to stdout */
- assert((size_t)snprintf(tmpstr, sizeof(tmpstr), "%s%s", wrkdir, oname)
- <= sizeof(tmpstr) -1);
+ len = (size_t)snprintf(tmpstr, sizeof(tmpstr), "%s%s", wrkdir, oname);
+ assert(len <= sizeof(tmpstr) - 1);
fp = fopen(tmpstr, "r");
if (unlink(tmpstr) < 0) {
perror("unlink");
More information about the svn-src-head
mailing list