Update length of target buffer

date	2004.12.08.18.24.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 17:56:25 +00:00
parent 88816b3bc9
commit 91ed5e3a93

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exstorob - AML Interpreter object store support, store to object
* $Revision: 1.49 $
* $Revision: 1.52 $
*
*****************************************************************************/
@ -10,7 +10,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
* All rights reserved.
*
* 2. License
@ -169,36 +169,37 @@ AcpiExStoreBufferToBuffer (
return_ACPI_STATUS (AE_NO_MEMORY);
}
TargetDesc->Common.Flags &= ~AOPOBJ_STATIC_POINTER;
TargetDesc->Buffer.Length = Length;
}
/*
* Buffer is a static allocation,
* only place what will fit in the buffer.
*/
/* Copy source buffer to target buffer */
if (Length <= TargetDesc->Buffer.Length)
{
/* Clear existing buffer and copy in the new one */
ACPI_MEMSET (TargetDesc->Buffer.Pointer, 0, TargetDesc->Buffer.Length);
ACPI_MEMCPY (TargetDesc->Buffer.Pointer, Buffer, Length);
/* Set the new length of the target */
TargetDesc->Buffer.Length = Length;
}
else
{
/*
* Truncate the source, copy only what will fit
*/
/* Truncate the source, copy only what will fit */
ACPI_MEMCPY (TargetDesc->Buffer.Pointer, Buffer, TargetDesc->Buffer.Length);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Truncating src buffer from %X to %X\n",
"Truncating source buffer from %X to %X\n",
Length, TargetDesc->Buffer.Length));
}
/* Copy flags */
TargetDesc->Buffer.Flags = SourceDesc->Buffer.Flags;
TargetDesc->Common.Flags &= ~AOPOBJ_STATIC_POINTER;
return_ACPI_STATUS (AE_OK);
}