]> git.baikalelectronics.ru Git - kernel.git/commit
mlx4: Use snprintf instead of complicated strcpy
authorQian Cai <cai@gmx.us>
Fri, 30 Nov 2018 02:18:07 +0000 (21:18 -0500)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 7 Dec 2018 03:23:06 +0000 (20:23 -0700)
commita3679c9e643cbea96acfa0969c708ecfe21b701a
treebd6d9ab5860f27db615c1418a93403d5fb767153
parent89541b9dcb270ea5174e7ee398be9c8dea03fd25
mlx4: Use snprintf instead of complicated strcpy

This fixes a compilation warning in sysfs.c

drivers/infiniband/hw/mlx4/sysfs.c:360:2: warning: 'strncpy' output may be
truncated copying 8 bytes from a string of length 31
[-Wstringop-truncation]

By eliminating the temporary stack buffer.

Signed-off-by: Qian Cai <cai@gmx.us>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx4/sysfs.c