else
p_type = "????";
- sprintf(queue_id, "%02u", port->external_qid);
+ snprintf(queue_id, sizeof(queue_id), "%02u",
+ port->external_qid);
if (port->p_type == OPDL_REGULAR_PORT ||
port->p_type == OPDL_ASYNC_PORT)
- sprintf(total_cyc,
+ snprintf(total_cyc, sizeof(total_cyc),
" %'16"PRIu64"",
(cpg != 0 ?
port->port_stat[total_cycles] / cpg
: 0));
else
- sprintf(total_cyc,
+ snprintf(total_cyc, sizeof(total_cyc),
" ----");
fprintf(f,
"%4s %10u %8u %9s %'16"PRIu64" %'16"PRIu64" %s "
uint32_t index = (i * max_num_port_xstat) + j;
/* Name */
- sprintf(device->port_xstat[index].stat.name,
- "port_%02u_%s",
- i,
- port_xstat_str[j]);
+ snprintf(device->port_xstat[index].stat.name,
+ sizeof(device->port_xstat[index].stat.name),
+ "port_%02u_%s", i, port_xstat_str[j]);
/* ID */
device->port_xstat[index].id = index;