aboutsummaryrefslogtreecommitdiff
path: root/core/pel.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/pel.c')
-rw-r--r--core/pel.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/pel.c b/core/pel.c
index 1f6d11b..5cbb3f1 100644
--- a/core/pel.c
+++ b/core/pel.c
@@ -67,7 +67,7 @@ static void create_extended_header_section(struct errorlog *elog_data,
static void settype(struct opal_src_section *src, uint8_t src_type)
{
char type[4];
- sprintf(type, "%02X", src_type);
+ snprintf(type, sizeof(type), "%02X", src_type);
memcpy(src->srcstring, type, 2);
}
@@ -75,7 +75,7 @@ static void settype(struct opal_src_section *src, uint8_t src_type)
static void setsubsys(struct opal_src_section *src, uint8_t src_subsys)
{
char subsys[4];
- sprintf(subsys, "%02X", src_subsys);
+ snprintf(subsys, sizeof(subsys), "%02X", src_subsys);
memcpy(src->srcstring+2, subsys, 2);
}
@@ -83,7 +83,7 @@ static void setsubsys(struct opal_src_section *src, uint8_t src_subsys)
static void setrefcode(struct opal_src_section *src, uint16_t src_refcode)
{
char refcode[8];
- sprintf(refcode, "%04X", src_refcode);
+ snprintf(refcode, sizeof(refcode), "%04X", src_refcode);
memcpy(src->srcstring+4, refcode, 4);
}