From cf9230659e8d64e95209a4d57cbda8a474049ddb Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 17 May 2024 16:10:00 -0400 Subject: Cast AT_FDCWD to int for comparisons Some platforms define AT_FDCWD to a constant like 0xFFFAFDCD that gets typed as an unsigned int. --- src/color.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/color.c') diff --git a/src/color.c b/src/color.c index 326291d..a0e553f 100644 --- a/src/color.c +++ b/src/color.c @@ -976,7 +976,7 @@ static ssize_t first_broken_offset(const char *path, const struct BFTW *ftwbuf, } else { // We're in print_link_target(), so resolve relative to the link's parent directory at_fd = ftwbuf->at_fd; - if (at_fd == AT_FDCWD && path[0] != '/') { + if (at_fd == (int)AT_FDCWD && path[0] != '/') { at_path = dstrndup(ftwbuf->path, ftwbuf->nameoff); if (at_path && dstrncat(&at_path, path, max) != 0) { ret = -1; -- cgit v1.2.3