fix printf format warnings
pgrep.c: In function 'main': pgrep.c:793:4: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long int' [-Wformat] vmstat.c: In function 'diskpartition_format': vmstat.c:382:9: warning: format '%u' expects argument of type 'unsigned int', but argument 5 has type 'long long unsigned int' [-Wformat] vmstat.c:408:10: warning: format '%u' expects argument of type 'unsigned int', but argument 5 has type 'long long unsigned int' [-Wformat] w.c: In function 'main': w.c:394:4: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat] Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
fc3bf171ff
commit
0da6537c5f
2
pgrep.c
2
pgrep.c
@ -779,7 +779,7 @@ int main (int argc, char **argv)
|
|||||||
if (errno==ESRCH)
|
if (errno==ESRCH)
|
||||||
// gone now, which is OK
|
// gone now, which is OK
|
||||||
continue;
|
continue;
|
||||||
xwarn(_("killing pid %ld failed"));
|
xwarn(_("killing pid %ld failed"), procs[i].num);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (opt_count) {
|
if (opt_count) {
|
||||||
|
2
vmstat.c
2
vmstat.c
@ -356,7 +356,7 @@ static int diskpartition_format(const char *partition_name)
|
|||||||
struct disk_stat *disks;
|
struct disk_stat *disks;
|
||||||
struct partition_stat *partitions, *current_partition = NULL;
|
struct partition_stat *partitions, *current_partition = NULL;
|
||||||
unsigned long ndisks, j, k, npartitions;
|
unsigned long ndisks, j, k, npartitions;
|
||||||
const char format[] = "%20u %10llu %10u %10u\n";
|
const char format[] = "%20u %10llu %10u %10llu\n";
|
||||||
|
|
||||||
fDiskstat = fopen("/proc/diskstats", "rb");
|
fDiskstat = fopen("/proc/diskstats", "rb");
|
||||||
if (!fDiskstat)
|
if (!fDiskstat)
|
||||||
|
2
w.c
2
w.c
@ -392,7 +392,7 @@ int main(int argc, char **argv)
|
|||||||
userlen = atoi(env_var);
|
userlen = atoi(env_var);
|
||||||
if (userlen < 8 || userlen > USERSZ) {
|
if (userlen < 8 || userlen > USERSZ) {
|
||||||
xwarnx
|
xwarnx
|
||||||
(_("User length environment PROCPS_USERLEN must be between 8 and %d, ignoring.\n"),
|
(_("User length environment PROCPS_USERLEN must be between 8 and %zu, ignoring.\n"),
|
||||||
USERSZ);
|
USERSZ);
|
||||||
userlen = 8;
|
userlen = 8;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user