mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
fix two minor bugs in nvramtool. (trivial)
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3582 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
4614aedd4b
commit
297b91c6cd
2 changed files with 5 additions and 4 deletions
|
@ -59,7 +59,7 @@ typedef struct
|
||||||
unsigned length;
|
unsigned length;
|
||||||
cmos_entry_config_t config;
|
cmos_entry_config_t config;
|
||||||
unsigned config_id;
|
unsigned config_id;
|
||||||
char name[CMOS_MAX_NAME_LENGTH];
|
char name[CMOS_MAX_NAME_LENGTH + 1];
|
||||||
}
|
}
|
||||||
cmos_entry_t;
|
cmos_entry_t;
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ cmos_entry_t;
|
||||||
typedef struct
|
typedef struct
|
||||||
{ unsigned config_id;
|
{ unsigned config_id;
|
||||||
unsigned long long value;
|
unsigned long long value;
|
||||||
char text[CMOS_MAX_TEXT_LENGTH];
|
char text[CMOS_MAX_TEXT_LENGTH + 1];
|
||||||
}
|
}
|
||||||
cmos_enum_t;
|
cmos_enum_t;
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||||
\*****************************************************************************/
|
\*****************************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "coreboot_tables.h"
|
#include "coreboot_tables.h"
|
||||||
|
@ -556,7 +557,7 @@ static void process_cmos_table (void)
|
||||||
for (p = first_cmos_table_enum(); p != NULL; p = next_cmos_table_enum(p))
|
for (p = first_cmos_table_enum(); p != NULL; p = next_cmos_table_enum(p))
|
||||||
{ cmos_enum.config_id = p->config_id;
|
{ cmos_enum.config_id = p->config_id;
|
||||||
cmos_enum.value = p->value;
|
cmos_enum.value = p->value;
|
||||||
strncpy(cmos_enum.text, p->text, CMOS_MAX_TEXT_LENGTH);
|
strncpy(cmos_enum.text, (char *)p->text, CMOS_MAX_TEXT_LENGTH);
|
||||||
cmos_enum.text[CMOS_MAX_TEXT_LENGTH] = '\0';
|
cmos_enum.text[CMOS_MAX_TEXT_LENGTH] = '\0';
|
||||||
try_add_cmos_table_enum(&cmos_enum);
|
try_add_cmos_table_enum(&cmos_enum);
|
||||||
}
|
}
|
||||||
|
@ -589,7 +590,7 @@ static void process_cmos_table (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
cmos_entry.config_id = q->config_id;
|
cmos_entry.config_id = q->config_id;
|
||||||
strncpy(cmos_entry.name, q->name, CMOS_MAX_NAME_LENGTH);
|
strncpy(cmos_entry.name, (char *)q->name, CMOS_MAX_NAME_LENGTH);
|
||||||
cmos_entry.name[CMOS_MAX_NAME_LENGTH] = '\0';
|
cmos_entry.name[CMOS_MAX_NAME_LENGTH] = '\0';
|
||||||
try_add_cmos_table_entry(&cmos_entry);
|
try_add_cmos_table_entry(&cmos_entry);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue