diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2015-03-17 11:18:16 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-03-17 17:06:21 +1100 |
commit | 8848bedba0a1cd306653c2365b757a840119aa1f (patch) | |
tree | df53b856a8c12856a6c0a23fb4fd22f74f07679f | |
parent | 320316c8fc5f59047390842230b729667aa2f6b8 (diff) | |
download | skiboot-8848bedba0a1cd306653c2365b757a840119aa1f.zip skiboot-8848bedba0a1cd306653c2365b757a840119aa1f.tar.gz skiboot-8848bedba0a1cd306653c2365b757a840119aa1f.tar.bz2 |
hdata: Fix location code size
Location codes are no more than 80 characters (including
terminating NULL char).
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | hdata/slca.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hdata/slca.c b/hdata/slca.c index 9dd679e..aaa5fc6 100644 --- a/hdata/slca.c +++ b/hdata/slca.c @@ -79,13 +79,13 @@ const char *slca_get_loc_code_index(uint16_t slca_index) void slca_vpd_add_loc_code(struct dt_node *node, uint16_t slca_index) { const char *fru_loc_code; - char loc_code[LOC_CODE_SIZE + 1]; + char loc_code[LOC_CODE_SIZE]; memset(loc_code, 0, sizeof(loc_code)); fru_loc_code = slca_get_loc_code_index(slca_index); if (!fru_loc_code) return; - strncpy(loc_code, fru_loc_code, LOC_CODE_SIZE); + strncpy(loc_code, fru_loc_code, LOC_CODE_SIZE - 1); dt_add_property(node, "ibm,loc-code", loc_code, strlen(loc_code) + 1); } |