diff options
Diffstat (limited to 'sys/contrib/dev/acpica/components/debugger/dbhistry.c')
-rw-r--r-- | sys/contrib/dev/acpica/components/debugger/dbhistry.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/contrib/dev/acpica/components/debugger/dbhistry.c b/sys/contrib/dev/acpica/components/debugger/dbhistry.c index e945779..b55f108 100644 --- a/sys/contrib/dev/acpica/components/debugger/dbhistry.c +++ b/sys/contrib/dev/acpica/components/debugger/dbhistry.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,7 +45,6 @@ #include <contrib/dev/acpica/include/accommon.h> #include <contrib/dev/acpica/include/acdebug.h> -#ifdef ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbhistry") @@ -92,7 +91,7 @@ AcpiDbAddToHistory ( /* Put command into the next available slot */ - CmdLen = (UINT16) ACPI_STRLEN (CommandLine); + CmdLen = (UINT16) strlen (CommandLine); if (!CmdLen) { return; @@ -100,8 +99,9 @@ AcpiDbAddToHistory ( if (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command != NULL) { - BufferLen = (UINT16) ACPI_STRLEN ( + BufferLen = (UINT16) strlen ( AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command); + if (CmdLen > BufferLen) { AcpiOsFree (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex]. @@ -116,7 +116,7 @@ AcpiDbAddToHistory ( AcpiOsAllocate (CmdLen + 1); } - ACPI_STRCPY (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command, + strcpy (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command, CommandLine); AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].CmdNum = @@ -217,7 +217,7 @@ AcpiDbGetFromHistory ( else { - CmdNum = ACPI_STRTOUL (CommandNumArg, NULL, 0); + CmdNum = strtoul (CommandNumArg, NULL, 0); } return (AcpiDbGetHistoryByIndex (CmdNum)); @@ -269,5 +269,3 @@ AcpiDbGetHistoryByIndex ( AcpiOsPrintf ("Invalid history number: %u\n", HistoryIndex); return (NULL); } - -#endif /* ACPI_DEBUGGER */ |