Skip to content

Commit

Permalink
[PATCH] s2io: change strncpy length arg to use size of target
Browse files Browse the repository at this point in the history
Use the size of the target array for the length argument to strncpy
instead of the size of the source or a magic number.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
  • Loading branch information
John W. Linville authored and Jeff Garzik committed Oct 4, 2005
1 parent 5323280 commit dbc2309
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/net/s2io.c
Original file line number Diff line number Diff line change
Expand Up @@ -4177,11 +4177,10 @@ static void s2io_ethtool_gdrvinfo(struct net_device *dev,
{
nic_t *sp = dev->priv;

strncpy(info->driver, s2io_driver_name, sizeof(s2io_driver_name));
strncpy(info->version, s2io_driver_version,
sizeof(s2io_driver_version));
strncpy(info->fw_version, "", 32);
strncpy(info->bus_info, pci_name(sp->pdev), 32);
strncpy(info->driver, s2io_driver_name, sizeof(info->driver));
strncpy(info->version, s2io_driver_version, sizeof(info->version));
strncpy(info->fw_version, "", sizeof(info->fw_version));
strncpy(info->bus_info, pci_name(sp->pdev), sizeof(info->bus_info));
info->regdump_len = XENA_REG_SPACE;
info->eedump_len = XENA_EEPROM_SPACE;
info->testinfo_len = S2IO_TEST_LEN;
Expand Down

0 comments on commit dbc2309

Please sign in to comment.