if (!strncmp(drd->d_name, "host", 4)) {
- sprintf(fcstat_filename, FC_RX_FRAMES, SYSFS_FCHOST, drd->d_name);
+ snprintf(fcstat_filename, MAX_PF_NAME, FC_RX_FRAMES,
+ SYSFS_FCHOST, drd->d_name);
if ((fp = fopen(fcstat_filename, "r"))) {
if (fgets(line, sizeof(line), fp)) {
sscanf(line, "%lx", &rx_frames);
fclose(fp);
}
- sprintf(fcstat_filename, FC_TX_FRAMES, SYSFS_FCHOST, drd->d_name);
+ snprintf(fcstat_filename, MAX_PF_NAME, FC_TX_FRAMES,
+ SYSFS_FCHOST, drd->d_name);
if ((fp = fopen(fcstat_filename, "r"))) {
if (fgets(line, sizeof(line), fp)) {
sscanf(line, "%lx", &tx_frames);
fclose(fp);
}
- sprintf(fcstat_filename, FC_RX_WORDS, SYSFS_FCHOST, drd->d_name);
+ snprintf(fcstat_filename, MAX_PF_NAME, FC_RX_WORDS,
+ SYSFS_FCHOST, drd->d_name);
if ((fp = fopen(fcstat_filename, "r"))) {
if (fgets(line, sizeof(line), fp)) {
sscanf(line, "%lx", &rx_words);
fclose(fp);
}
- sprintf(fcstat_filename, FC_TX_WORDS, SYSFS_FCHOST, drd->d_name);
+ snprintf(fcstat_filename, MAX_PF_NAME, FC_TX_WORDS,
+ SYSFS_FCHOST, drd->d_name);
if ((fp = fopen(fcstat_filename, "r"))) {
if (fgets(line, sizeof(line), fp)) {
sscanf(line, "%lx", &tx_words);