FreeBSD/sys/contrib/dev/acpica/compiler/dtfield.c
/******************************************************************************
 *
 * FUNCTION:    DtCompileString
 *
 * PARAMETERS:  Buffer              - Output buffer
 *              Field               - String to be copied to buffer
 *              ByteLength          - Maximum length of string
 *
 * RETURN:      None
 *
 * DESCRIPTION: Copy string to the buffer
 *
 *****************************************************************************/
DtCompileString
PARAMETERS:  Buffer              - Output buffer
Field               - String to be copied to buffer
ByteLength          - Maximum length of string

None

Copy string to the buffer
DtCompileString PARAMETERS : Buffer - Output buffer Field - String to be copied to buffer ByteLength - Maximum length of string None Copy string to the buffer
static void
DtCompileString (
    UINT8                   *Buffer,
    DT_FIELD                *Field,
    UINT32                  ByteLength)
{
    UINT32                  Length;
    Length = strlen (Field->Value);
    if (Length > ByteLength)
    {
        sprintf (MsgBuffer, "Maximum %u characters", ByteLength);
        DtError (ASL_ERROR, ASL_MSG_STRING_LENGTH, Field, MsgBuffer);
        Length = ByteLength;
    }
    memcpy (Buffer, Field->Value, Length);
}
static void DtCompileString ( UINT8 * Buffer , DT_FIELD * Field , UINT32 ByteLength ) { UINT32 Length ; Length = strlen ( Field -> Value ) ; if ( Length > ByteLength ) { sprintf ( MsgBuffer , " " , ByteLength ) ; DtError ( ASL_ERROR , ASL_MSG_STRING_LENGTH , Field , MsgBuffer ) ; Length = ByteLength ; } memcpy ( Buffer , Field -> Value , Length ) ; }
FUNCTION:    DtCompileString
 PARAMETERS:  Buffer              - Output buffer
              Field               - String to be copied to buffer
              ByteLength          - Maximum length of string
FUNCTION : DtCompileString PARAMETERS : Buffer - Output buffer Field - String to be copied to buffer ByteLength - Maximum length of string
/* Check if the string is too long for the field */