diff options
author | Michal Suchanek <msuchanek@suse.de> | 2019-03-13 20:18:15 +0100 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2019-03-20 14:27:08 +1100 |
commit | bef1ddc40813976f0f422ade4a5b9374176ca22a (patch) | |
tree | 79758551da9a484439d31179fecd7e3fd1cc95bd /libflash | |
parent | 92a5c57a14e24a60c306a9106bd6415c03f1234d (diff) | |
download | skiboot-bef1ddc40813976f0f422ade4a5b9374176ca22a.zip skiboot-bef1ddc40813976f0f422ade4a5b9374176ca22a.tar.gz skiboot-bef1ddc40813976f0f422ade4a5b9374176ca22a.tar.bz2 |
libffs: Fix string truncation gcc warning.
Use memcpy as other libffs functions do.
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'libflash')
-rw-r--r-- | libflash/libffs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libflash/libffs.c b/libflash/libffs.c index 221c2b0..82caeb3 100644 --- a/libflash/libffs.c +++ b/libflash/libffs.c @@ -522,7 +522,7 @@ int ffs_part_info(struct ffs_handle *ffs, uint32_t part_idx, n = calloc(1, FFS_PART_NAME_MAX + 1); if (!n) return FLASH_ERR_MALLOC_FAILED; - strncpy(n, ent->name, FFS_PART_NAME_MAX); + memcpy(n, ent->name, FFS_PART_NAME_MAX); *name = n; } return 0; |