Browse Source

[smbios] Default to "hex" type for non-string SMBIOS settings

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 years ago
parent
commit
c4500fb7ca
1 changed files with 10 additions and 3 deletions
  1. 10
    3
      src/interface/smbios/smbios_settings.c

+ 10
- 3
src/interface/smbios/smbios_settings.c View File

120
 
120
 
121
 		if ( tag_len == 0 ) {
121
 		if ( tag_len == 0 ) {
122
 			/* String */
122
 			/* String */
123
-			return read_smbios_string ( &structure,
124
-						    buf[tag_offset],
125
-						    data, len );
123
+			if ( ( rc = read_smbios_string ( &structure,
124
+							 buf[tag_offset],
125
+							 data, len ) ) < 0 ) {
126
+				return rc;
127
+			}
128
+			if ( ! setting->type )
129
+				setting->type = &setting_type_string;
130
+			return rc;
126
 		} else {
131
 		} else {
127
 			/* Raw data */
132
 			/* Raw data */
128
 			if ( len > tag_len )
133
 			if ( len > tag_len )
129
 				len = tag_len;
134
 				len = tag_len;
130
 			memcpy ( data, &buf[tag_offset], len );
135
 			memcpy ( data, &buf[tag_offset], len );
136
+			if ( ! setting->type )
137
+				setting->type = &setting_type_hex;
131
 			return tag_len;
138
 			return tag_len;
132
 		}
139
 		}
133
 	}
140
 	}

Loading…
Cancel
Save