aboutsummaryrefslogtreecommitdiff
path: root/procps/watch.c
diff options
context:
space:
mode:
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2008-05-18 22:28:26 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2008-05-18 22:28:26 +0000
commit5599502a550a7f892d4b73dceb2105a6916f83e6 (patch)
tree572ffa27892b1b24db86930044077dbb1565840f /procps/watch.c
parente125a683a77d14401644d15f38b7f578db723924 (diff)
downloadbusybox-5599502a550a7f892d4b73dceb2105a6916f83e6.tar.gz
busybox-5599502a550a7f892d4b73dceb2105a6916f83e6.tar.bz2
more -Wall warning fixes. -Wall is enabled now.
Diffstat (limited to 'procps/watch.c')
-rw-r--r--procps/watch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/procps/watch.c b/procps/watch.c
index 5b774e808..7d8e0de1f 100644
--- a/procps/watch.c
+++ b/procps/watch.c
@@ -28,7 +28,7 @@ int watch_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
unsigned opt;
unsigned period = 2;
- int width, new_width;
+ unsigned width, new_width;
char *header;
char *cmd;
@@ -43,19 +43,19 @@ int watch_main(int argc ATTRIBUTE_UNUSED, char **argv)
while (*++argv)
cmd = xasprintf("%s %s", cmd, *argv); // leaks cmd
- width = -1; // make sure first time new_width != width
+ width = (unsigned)-1; // make sure first time new_width != width
header = NULL;
while (1) {
printf("\033[H\033[J");
if (!(opt & 0x2)) { // no -t
- const int time_len = sizeof("1234-67-90 23:56:89");
+ const unsigned time_len = sizeof("1234-67-90 23:56:89");
time_t t;
get_terminal_width_height(STDIN_FILENO, &new_width, NULL);
if (new_width != width) {
width = new_width;
free(header);
- header = xasprintf("Every %us: %-*s", period, width, cmd);
+ header = xasprintf("Every %us: %-*s", period, (int)width, cmd);
}
time(&t);
if (time_len < width)