aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2014-11-28 17:23:32 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2014-11-28 17:23:32 +1100
commit124591c0f398341c0262ee2804c08c6f0e2dbdf6 (patch)
treee7cc9a17a0c3a6e1818264d54bbc79b61a095ec4 /core
parent209611863a21e335daff50a94257d0f7fd145cdc (diff)
downloadskiboot-124591c0f398341c0262ee2804c08c6f0e2dbdf6.zip
skiboot-124591c0f398341c0262ee2804c08c6f0e2dbdf6.tar.gz
skiboot-124591c0f398341c0262ee2804c08c6f0e2dbdf6.tar.bz2
Remove sprintf: there's no good reason to have this in firmware
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-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);
}