mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zgetdump: Replace strncpy() with memcpy()
We can safely replace strncpy() with memcpy() here and get rid of the following compile warnings: dfi_s390mv.c: In function ‘set_magic_numbers’: dfi_s390mv.c:570:3: warning: ‘strncpy’ output truncated before terminating nul copying 7 bytes fr om a string of the same length [-Wstringop-truncation] strncpy(l.dumper_magic, DF_S390_DUMPER_MAGIC_MV_EXT, 7); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dfi_s390mv.c:573:3: warning: ‘strncpy’ output truncated before terminating nul copying 7 bytes fr om a string of the same length [-Wstringop-truncation] strncpy(l.dumper_magic, DF_S390_DUMPER_MAGIC_MV, 7); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
@@ -568,10 +568,10 @@ static void set_magic_numbers(void)
|
||||
{
|
||||
if (l.extended) {
|
||||
l.magic_number = DF_S390_MAGIC_EXT;
|
||||
strncpy(l.dumper_magic, DF_S390_DUMPER_MAGIC_MV_EXT, 7);
|
||||
memcpy(l.dumper_magic, DF_S390_DUMPER_MAGIC_MV_EXT, 7);
|
||||
} else {
|
||||
l.magic_number = DF_S390_MAGIC;
|
||||
strncpy(l.dumper_magic, DF_S390_DUMPER_MAGIC_MV, 7);
|
||||
memcpy(l.dumper_magic, DF_S390_DUMPER_MAGIC_MV, 7);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user