avoid signed<->unsigned warning
[oweals/busybox.git] / libbb / dump.c
index 52a6c063b77b791ff9daf7cb0448dcfed834426c..7d923083ad7e94255060e2aa79c2a4ac9788bc2e 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 #include <ctype.h>             /* for isdigit() */
 #include "libbb.h"
 #include "dump.h"
@@ -498,7 +499,7 @@ static void conv_u(PR * pr, u_char * p)
        /* od used nl, not lf */
        if (*p <= 0x1f) {
                *pr->cchar = 's';
-               printf(pr->fmt, list[4 * (int)(*p)]);
+               printf(pr->fmt, list + (4 * (int)*p));
        } else if (*p == 0x7f) {
                *pr->cchar = 's';
                printf(pr->fmt, "del");
@@ -544,7 +545,7 @@ static void display(void)
 /*                      PRINT; */
                                                switch (pr->flags) {
                                                case F_ADDRESS:
-                                                       printf(pr->fmt, address);
+                                                       printf(pr->fmt, (unsigned int) address);
                                                        break;
                                                case F_BPAD:
                                                        printf(pr->fmt, "");
@@ -694,7 +695,7 @@ void bb_dump_add(const char *fmt)
 
        /* start new linked list of format units */
        /* NOSTRICT */
-       tfs = (FS *) xcalloc(1,sizeof(FS)); /*DBU:[dave@cray.com] start out NULL */
+       tfs = (FS *) xcalloc(1,sizeof(FS)); /*DBU:[dave@cray.com] start out NULL */
        if (!bb_dump_fshead) {
                bb_dump_fshead = tfs;
        } else {