char lineout[30];
day_array(month, year, dp);
- len = sprintf(lineout, "%s %d", month_names[month - 1], year);
+ len = sprintf(lineout, "%s %u", month_names[month - 1], year);
printf("%*s%s\n%s\n",
((7*julian + WEEK_LEN) - len) / 2, "",
lineout, day_headings);
if (type >= SUM_SYSV) {
r = (s & 0xffff) + ((s & 0xffffffff) >> 16);
s = (r & 0xffff) + (r >> 16);
- printf("%d %llu %s\n", s, (total_bytes + 511) / 512, file);
+ printf("%u %llu %s\n", s, (total_bytes + 511) / 512, file);
} else
- printf("%05d %5llu %s\n", s, (total_bytes + 1023) / 1024, file);
+ printf("%05u %5llu %s\n", s, (total_bytes + 1023) / 1024, file);
return 1;
#undef buf
}
errcode_t retval;
char buf[1024];
- sprintf(buf, "badblocks -b %d %s%s%s %d", fs->blocksize,
+ sprintf(buf, "badblocks -b %u %s%s%s %d", fs->blocksize,
quiet ? "" : "-s ", (cflag > 1) ? "-w " : "",
fs->device_name, fs->super->s_blocks_count);
mke2fs_verbose("Running command: %s\n", buf);
if (e_flag) {
sb->s_errors = errors;
ext2fs_mark_super_dirty(fs);
- printf("Setting error behavior to %d\n", errors);
+ printf("Setting error behavior to %u\n", errors);
}
if (g_flag) {
sb->s_def_resgid = resgid;
return;
}
if (!quiet)
- printf("Creating journal (%ld blocks): ", journal_blocks);
+ printf("Creating journal (%lu blocks): ", journal_blocks);
fflush(stdout);
retval = ext2fs_add_journal_inode(fs, journal_blocks,
journal_flags);
unsigned src_last_line = 1;
unsigned dst_last_line = 1;
- if ((sscanf(patch_line, "@@ -%d,%d +%d,%d", &src_beg_line, &src_last_line, &dst_beg_line, &dst_last_line) < 3)
- && (sscanf(patch_line, "@@ -%d +%d,%d", &src_beg_line, &dst_beg_line, &dst_last_line) < 2)
+ if ((sscanf(patch_line, "@@ -%u,%u +%u,%u", &src_beg_line, &src_last_line, &dst_beg_line, &dst_last_line) < 3)
+ && (sscanf(patch_line, "@@ -%u +%u,%u", &src_beg_line, &dst_beg_line, &dst_last_line) < 2)
) {
/* No more hunks for this file */
break;
static void print_flag_on_off(int get_arg, const char *s, unsigned long arg)
{
if (get_arg) {
- printf(" setting %s to %ld", s, arg);
+ printf(" setting %s to %lu", s, arg);
on_off(arg);
}
}
static void print_value_on_off(const char *str, unsigned long argp)
{
- printf(" %s\t= %2ld", str, argp);
+ printf(" %s\t= %2lu", str, argp);
on_off(argp != 0);
}
else if (value == BUSSTATE_TRISTATE)
printf(" (tristate)\n");
else
- printf(" (unknown: %d)\n", value);
+ printf(" (unknown: %u)\n", value);
}
#endif
static void print_flag(int flag, const char *s, unsigned long value)
{
if (flag)
- printf(" setting %s to %ld\n", s, value);
+ printf(" setting %s to %lu\n", s, value);
}
static void process_dev(char *devname)
arp_disp(hostname, ip, type, flags, hwa, mask, dev);
}
if (option_mask32 & ARP_OPT_v)
- printf("Entries: %d\tSkipped: %d\tFound: %d\n",
+ printf("Entries: %u\tSkipped: %u\tFound: %u\n",
entries, entries - shown, shown);
if (!shown) {
if (hw_set || host || device[0])
- printf("No match found in %d entries\n", entries);
+ printf("No match found in %u entries\n", entries);
}
if (ENABLE_FEATURE_CLEAN_UP) {
free((char*)host);
*/
#define ADDR_WIDE 51 /* INET6_ADDRSTRLEN + 5 for the port number */
#if ENABLE_FEATURE_NETSTAT_WIDE
-# define FMT_NET_CONN_DATA "%s %6ld %6ld %-*s %-*s %-12s"
+# define FMT_NET_CONN_DATA "%s %6lu %6lu %-*s %-*s %-12s"
# define FMT_NET_CONN_HEADER "\nProto Recv-Q Send-Q %-*s %-*s State %s\n"
#else
-# define FMT_NET_CONN_DATA "%s %6ld %6ld %-23s %-23s %-12s"
+# define FMT_NET_CONN_DATA "%s %6lu %6lu %-23s %-23s %-12s"
# define FMT_NET_CONN_HEADER "\nProto Recv-Q Send-Q %-23s %-23s State %s\n"
#endif
"%*d: %32[0-9A-Fa-f]:%X "
"%32[0-9A-Fa-f]:%X %X "
"%lX:%lX %*X:%*X "
- "%*X %d %*d %ld ",
+ "%*X %d %*d %lu ",
local_addr, ¶m->local_port,
rem_addr, ¶m->rem_port, ¶m->state,
¶m->txq, ¶m->rxq,
strcat(ss_flags, "N ");
strcat(ss_flags, "]");
- printf("%-5s %-6ld %-11s %-10s %-13s %6lu ",
+ printf("%-5s %-6lu %-11s %-10s %-13s %6lu ",
ss_proto, refcnt, ss_flags, ss_type, ss_state, inode
);
}
if (ENABLE_FEATURE_CLEAN_UP) free(lsap);
- printf("%d closed, %d open, %d timed out (or blocked) ports\n",
+ printf("%u closed, %u open, %u timed out (or blocked) ports\n",
closed_ports,
open_ports,
nports - (closed_ports + open_ports));
{
if (pgrep) {
if (option_mask32 & (1 << OPTBIT_L)) /* OPT_LIST */
- printf("%d %s\n", pid, cmd);
+ printf("%u %s\n", pid, cmd);
else
- printf("%d\n", pid);
+ printf("%u\n", pid);
} else
kill(pid, signo);
}
if (s->vsz >= 100000)
sprintf(vsz_str_buf, "%6ldm", s->vsz/1024);
else
- sprintf(vsz_str_buf, "%7ld", s->vsz);
+ sprintf(vsz_str_buf, "%7lu", s->vsz);
/* PID PPID USER STAT VSZ %VSZ [%CPU] COMMAND */
col = snprintf(line_buf, scr_width,
"\n" "%5u%6u %-8.8s %s%s" FMT
shbuf_data = shbuf->data; /* pointer! */
if (DEBUG)
- printf("cur:%d tail:%i size:%i\n",
+ printf("cur:%u tail:%u size:%u\n",
cur, shbuf_tail, shbuf_size);
if (!follow) {
/* original message was: "Could not determine current format type" */
xioctl(fd, FDGETPRM, ¶m);
- printf("%s-sided, %d tracks, %d sec/track. Total capacity %d kB\n",
+ printf("%s-sided, %u tracks, %u sec/track. Total capacity %d kB\n",
(param.head == 2) ? "Double" : "Single",
param.track, param.sect, param.size >> 1);
total++;
if (!inode_count[nr]) {
if (!inode_in_use(nr)) {
- printf("Inode %d is marked as 'unused', but it is used "
+ printf("Inode %u is marked as 'unused', but it is used "
"for file '%s'\n", nr, current_name);
if (OPT_repair) {
if (ask("Mark as 'in use'", 1))
case STATUS:
printf("------ Shared Memory %s --------\n", "Status");
printf("segments allocated %d\n"
- "pages allocated %ld\n"
- "pages resident %ld\n"
- "pages swapped %ld\n"
- "Swap performance: %ld attempts\t%ld successes\n",
+ "pages allocated %lu\n"
+ "pages resident %lu\n"
+ "pages swapped %lu\n"
+ "Swap performance: %lu attempts\t%lu successes\n",
shm_info.used_ids,
shm_info.shm_tot,
shm_info.shm_rss,
if (val < 0 || ncnt < 0 || zcnt < 0 || pid < 0) {
bb_perror_msg_and_die("semctl");
}
- printf("%-10d %-10d %-10d %-10d %-10d\n", i, val, ncnt, zcnt, pid);
+ printf("%-10u %-10d %-10d %-10d %-10d\n", i, val, ncnt, zcnt, pid);
}
bb_putchar('\n');
}
listfile = xfopen_for_read(filename);
while (!feof(listfile)) {
- fscanf(listfile, "%ld\n", &blockno);
+ fscanf(listfile, "%lu\n", &blockno);
mark_zone(blockno);
G.badblocks++;
}
step = buf[0];
if (optInfo) {
- printf("Sampling_step: %i\n", step);
+ printf("Sampling_step: %u\n", step);
return EXIT_SUCCESS;
}
&& (fn_len = next_add-fn_add) != 0
) {
if (optVerbose)
- printf("%016llx %-40s %6i %8.4f\n", fn_add,
+ printf("%016llx %-40s %6u %8.4f\n", fn_add,
fn_name, this, this/(double)fn_len);
else
- printf("%6i %-40s %8.4f\n",
+ printf("%6u %-40s %8.4f\n",
this, fn_name, this/(double)fn_len);
if (optSub) {
unsigned long long scan;
}
/* clock ticks, out of kernel text - probably modules */
- printf("%6i %s\n", buf[len/sizeof(*buf)-1], "*unknown*");
+ printf("%6u %s\n", buf[len/sizeof(*buf)-1], "*unknown*");
/* trailer */
if (optVerbose)
- printf("%016x %-40s %6i %8.4f\n",
+ printf("%016x %-40s %6u %8.4f\n",
0, "total", total, total/(double)(fn_add-add0));
else
- printf("%6i %-40s %8.4f\n",
+ printf("%6u %-40s %8.4f\n",
total, "total", total/(double)(fn_add-add0));
fclose(map);