• Arnd Bergmann's avatar
    net: qed: use correct strncpy() size · 11f71108
    Arnd Bergmann authored
    passing the strlen() of the source string as the destination
    length is pointless, and gcc-8 now warns about it:
    
    drivers/net/ethernet/qlogic/qed/qed_debug.c: In function 'qed_grc_dump':
    include/linux/string.h:253: error: 'strncpy' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
    
    This changes qed_grc_dump_big_ram() to instead uses the length of
    the destination buffer, and use strscpy() to guarantee nul-termination.
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    11f71108
qed_debug.c 221 KB