break;
if(k > 0)
channels[j++] = ',';
- snprintf(channels + j, 100 - j, "%d", route->channels[k]);
+ snprintf(channels + j, 100 - j, "%u", route->channels[k]);
j = strlen(channels);
}
snprintf(channels + j, 100 - j, ")");
static char buf[4][15];
static int i = 0;
i = (i + 1) % 4;
- snprintf(buf[i], 15, "%d.%.3d", value / 1000, value % 1000);
+ snprintf(buf[i], 15, "%u.%.3u", value / 1000, value % 1000);
return buf[i];
}
log_verbose("Mem: %d\n", get_memory_usage(getpid()));
csv_init(&csv, buf, 256);
- sprintf(hdr1, "%4u", 0);
- sprintf(hdr2, "%4u", 1);
+ sprintf(hdr1, "%4d", 0);
+ sprintf(hdr2, "%4d", 1);
log_verbose("(%zu/%zu/%d/%d)\n", strlen(hdr1), strlen(hdr2), atoi(hdr1),
atoi(hdr2));
rec = csv_encode(&csv, 2, hdr1, hdr2);
}
csv_encode(&csv, 2, "pdfadfadfadsadsaddfdfdsfdsd", "35444554545454545");
log_verbose("%s\n", buf);
- sprintf(hdr1, "%4u", csv.csv_len);
- sprintf(hdr2, "%4u", 1);
+ sprintf(hdr1, "%4d", csv.csv_len);
+ sprintf(hdr2, "%4d", 1);
log_verbose("(%zu/%zu/%d/%d)\n", strlen(hdr1), strlen(hdr2), atoi(hdr1),
atoi(hdr2));
rec = csv_encode_record(&csv, rec, 2, hdr1, hdr2);
char client_buf[32];
csv_record_t *rec1;
- sprintf(msglen_buf, "%4u", msglen);
- sprintf(vers_buf, "%4u", version);
- sprintf(type_buf, "%4u", type);
- sprintf(cmdid_buf, "%4u", cmd_id);
+ sprintf(msglen_buf, "%4d", msglen);
+ sprintf(vers_buf, "%4d", version);
+ sprintf(type_buf, "%4d", type);
+ sprintf(cmdid_buf, "%4d", cmd_id);
snprintf(client_buf, 17, "%16.16s", client_name);
if (rec) {
rec1 = csv_encode_record(csv, rec, 5, msglen_buf, vers_buf,
}
if (w > 99)
- snprintf(buf, size, "%ldw%1ldd", w, d);
+ snprintf(buf, size, "%luw%1lud", w, d);
else if (w)
- snprintf(buf, size, "%ldw%1ldd%02ldh", w, d, h);
+ snprintf(buf, size, "%luw%1lud%02luh", w, d, h);
else if (d)
- snprintf(buf, size, "%1ldd%02ldh%02ldm", d, h, m);
+ snprintf(buf, size, "%1lud%02luh%02lum", d, h, m);
else if (h)
- snprintf(buf, size, "%ldh%02ldm%02lds", h, m, (long)t->tv_sec);
+ snprintf(buf, size, "%luh%02lum%02lds", h, m, (long)t->tv_sec);
else if (m)
- snprintf(buf, size, "%ldm%02lds", m, (long)t->tv_sec);
+ snprintf(buf, size, "%lum%02lds", m, (long)t->tv_sec);
else if (ms)
- snprintf(buf, size, "%ld.%03lds", (long)t->tv_sec, ms);
+ snprintf(buf, size, "%ld.%03lus", (long)t->tv_sec, ms);
else
snprintf(buf, size, "%ld usecs", (long)t->tv_usec);
return CMD_SUCCESS;
if (ospf->instance)
- sprintf(str, " %d", ospf->instance);
+ sprintf(str, " %u", ospf->instance);
/* debug ospf ism (status|events|timers). */
if (IS_CONF_DEBUG_OSPF(ism, ISM) == OSPF_DEBUG_ISM)
"ospf_vl_new(): creating pseudo zebra interface vrf id %u",
ospf->vrf_id);
- snprintf(ifname, sizeof(ifname), "VLINK%d", vlink_count);
+ snprintf(ifname, sizeof(ifname), "VLINK%u", vlink_count);
vi = if_create(ifname, ospf->vrf_id);
/*
* if_create sets ZEBRA_INTERFACE_LINKDETECTION
printf("verify: lib failed\n");
if (ospfd != lib) {
- printf("Mismatch in values at size %u\n"
+ printf("Mismatch in values at size %d\n"
"ospfd: 0x%04x\tc0: %d\tc1: %d\tx: %d\ty: %d\n"
"isisd: 0x%04x\tc0: %d\tc1: %d\tx: %d\ty: %d\n"
"lib: 0x%04x\n",
/* create vertices */
for (unsigned int i = 0; i < NUMNODES; i++) {
- snprintf(names[i], sizeof(names[i]), "%d", i);
+ snprintf(names[i], sizeof(names[i]), "%u", i);
gn[i] = graph_new_node(g, names[i], NULL);
}
t_remove = 1000 * (tv_stop.tv_sec - tv_lap.tv_sec);
t_remove += (tv_stop.tv_usec - tv_lap.tv_usec) / 1000;
- printf("Scheduling %d random timers took %ld.%03ld seconds.\n",
+ printf("Scheduling %d random timers took %lu.%03lu seconds.\n",
SCHEDULE_TIMERS, t_schedule / 1000, t_schedule % 1000);
- printf("Removing %d random timers took %ld.%03ld seconds.\n",
+ printf("Removing %d random timers took %lu.%03lu seconds.\n",
REMOVE_TIMERS, t_remove / 1000, t_remove % 1000);
fflush(stdout);