diff options
author | Kenny Root <kroot@google.com> | 2012-10-10 11:26:54 -0700 |
---|---|---|
committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2013-07-18 20:38:39 +0100 |
commit | 0cbf7ea544af6fe190ee158528d9671b063a9e4a (patch) | |
tree | 282f7f3fb25efac348831163e906e3c7200b9a0d | |
parent | 56ef4f0cca828febcd923833b22c38c3e61b0285 (diff) | |
download | system_core-0cbf7ea544af6fe190ee158528d9671b063a9e4a.zip system_core-0cbf7ea544af6fe190ee158528d9671b063a9e4a.tar.gz system_core-0cbf7ea544af6fe190ee158528d9671b063a9e4a.tar.bz2 |
toolbox: silence some compiler warnings
Comparison of signed and unsigned integers. Use parenthesis around a
group of bitwise OR operations.
Change-Id: Ia404380593ce2c2a291133c07c0fc7a016a3ad3f
-rw-r--r-- | toolbox/ls.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/toolbox/ls.c b/toolbox/ls.c index a4db99c..b7ba1b7 100644 --- a/toolbox/ls.c +++ b/toolbox/ls.c @@ -276,12 +276,12 @@ static int listfile_maclabel(const char *path, int flags) switch(s.st_mode & S_IFMT) { case S_IFLNK: { char linkto[256]; - int len; + ssize_t len; len = readlink(path, linkto, sizeof(linkto)); if(len < 0) return -1; - if(len > sizeof(linkto)-1) { + if((size_t)len > sizeof(linkto)-1) { linkto[sizeof(linkto)-4] = '.'; linkto[sizeof(linkto)-3] = '.'; linkto[sizeof(linkto)-2] = '.'; @@ -307,7 +307,7 @@ static int listfile_maclabel(const char *path, int flags) static int listfile(const char *dirname, const char *filename, int flags) { - if ((flags & LIST_LONG | LIST_SIZE | LIST_CLASSIFY | LIST_MACLABEL) == 0) { + if ((flags & (LIST_LONG | LIST_SIZE | LIST_CLASSIFY | LIST_MACLABEL)) == 0) { printf("%s\n", filename); return 0; } |