Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Merge "toolbox: silence some compiler warnings"
Browse files Browse the repository at this point in the history
  • Loading branch information
kruton authored and Gerrit Code Review committed Oct 11, 2012
2 parents 33045b3 + ef5d034 commit 674c044
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions toolbox/ls.c
Expand Up @@ -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] = '.';
Expand All @@ -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;
}
Expand Down

0 comments on commit 674c044

Please sign in to comment.