}
table_status = ap_dump_table_buffer(table, instance, address);
- free(table);
+ ACPI_FREE(table);
if (table_status) {
break;
}
table_status = ap_dump_table_buffer(table, 0, address);
- free(table);
+ ACPI_FREE(table);
return (table_status);
}
acpi_status status;
int table_status;
- if (strlen(signature) != ACPI_NAME_SIZE) {
+ if (ACPI_STRLEN(signature) != ACPI_NAME_SIZE) {
fprintf(stderr,
"Invalid table signature [%s]: must be exactly 4 characters\n",
signature);
/* Table signatures are expected to be uppercase */
- strcpy(local_signature, signature);
+ ACPI_STRCPY(local_signature, signature);
acpi_ut_strupr(local_signature);
/* To be friendly, handle tables whose signatures do not match the name */
if (ACPI_COMPARE_NAME(local_signature, "FADT")) {
- strcpy(local_signature, ACPI_SIG_FADT);
+ ACPI_STRCPY(local_signature, ACPI_SIG_FADT);
} else if (ACPI_COMPARE_NAME(local_signature, "MADT")) {
- strcpy(local_signature, ACPI_SIG_MADT);
+ ACPI_STRCPY(local_signature, ACPI_SIG_MADT);
}
/* Dump all instances of this signature (to handle multiple SSDTs) */
}
table_status = ap_dump_table_buffer(table, instance, address);
- free(table);
+ ACPI_FREE(table);
if (table_status) {
break;
table_status = ap_dump_table_buffer(table, 0, 0);
exit:
- free(table);
+ ACPI_FREE(table);
return (table_status);
}
/* Handle multiple SSDts - create different filenames for each */
if (instance > 0) {
- sprintf(instance_str, "%u", instance);
- strcat(filename, instance_str);
+ acpi_ut_snprintf(instance_str, sizeof(instance_str), "%u",
+ instance);
+ ACPI_STRCAT(filename, instance_str);
}
- strcat(filename, ACPI_TABLE_FILE_SUFFIX);
+ ACPI_STRCAT(filename, ACPI_TABLE_FILE_SUFFIX);
if (gbl_verbose_mode) {
fprintf(stderr,
/* Allocate a buffer for the entire file */
- buffer = calloc(1, file_size);
+ buffer = ACPI_ALLOCATE_ZEROED(file_size);
if (!buffer) {
fprintf(stderr,
"Could not allocate file buffer of size: %u\n",
actual = fread(buffer, 1, file_size, file);
if (actual != file_size) {
fprintf(stderr, "Could not read input file: %s\n", pathname);
- free(buffer);
+ ACPI_FREE(buffer);
buffer = NULL;
goto cleanup;
}