mirror of
https://github.com/xcat2/xNBA.git
synced 2025-02-16 18:48:12 +00:00
[smbios] Default to "hex" type for non-string SMBIOS settings
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
25ec56e0ec
commit
c4500fb7ca
@ -120,14 +120,21 @@ static int smbios_fetch ( struct settings *settings __unused,
|
||||
|
||||
if ( tag_len == 0 ) {
|
||||
/* String */
|
||||
return read_smbios_string ( &structure,
|
||||
buf[tag_offset],
|
||||
data, len );
|
||||
if ( ( rc = read_smbios_string ( &structure,
|
||||
buf[tag_offset],
|
||||
data, len ) ) < 0 ) {
|
||||
return rc;
|
||||
}
|
||||
if ( ! setting->type )
|
||||
setting->type = &setting_type_string;
|
||||
return rc;
|
||||
} else {
|
||||
/* Raw data */
|
||||
if ( len > tag_len )
|
||||
len = tag_len;
|
||||
memcpy ( data, &buf[tag_offset], len );
|
||||
if ( ! setting->type )
|
||||
setting->type = &setting_type_hex;
|
||||
return tag_len;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user