diff --git a/src/browser.c b/src/browser.c index 6419a87..26a27fe 100644 --- a/src/browser.c +++ b/src/browser.c @@ -75,9 +75,9 @@ static void browse_draw_info(struct dir *dr) { time_t t = (time_t)e->mtime; if(e->flags & FFE_MODE) ncaddstr(4, 9, fmtmode(e->mode)); else ncaddstr(4, 9, "N/A"); - if(e->flags & FFE_UID) ncprint(4, 26, "%d", e->uid); + if(e->flags & FFE_UID) ncprint(4, 26, "%u", e->uid); else ncaddstr(4, 26, "N/A"); - if(e->flags & FFE_GID) ncprint(4, 38, "%d", e->gid); + if(e->flags & FFE_GID) ncprint(4, 38, "%u", e->gid); else ncaddstr(4, 38, "N/A"); if(e->flags & FFE_MTIME) { strftime(mbuf, sizeof(mbuf), "%Y-%m-%d %H:%M:%S %z", localtime(&t)); diff --git a/src/dir_import.c b/src/dir_import.c index d1a2ce5..c7e67ae 100644 --- a/src/dir_import.c +++ b/src/dir_import.c @@ -469,12 +469,12 @@ static int iteminfo(void) { C(rint64(&iv, UINT64_MAX)); ctx->buf_dir->ino = iv; } else if(strcmp(ctx->val, "uid") == 0) { /* uid */ - C(rint64(&iv, INT32_MAX)); + C(rint64(&iv, UINT32_MAX)); ctx->buf_dir->flags |= FF_EXT; ctx->buf_ext->flags |= FFE_UID; ctx->buf_ext->uid = iv; } else if(strcmp(ctx->val, "gid") == 0) { /* gid */ - C(rint64(&iv, INT32_MAX)); + C(rint64(&iv, UINT32_MAX)); ctx->buf_dir->flags |= FF_EXT; ctx->buf_ext->flags |= FFE_GID; ctx->buf_ext->gid = iv; diff --git a/src/dir_scan.c b/src/dir_scan.c index f8b14be..bf2ff42 100644 --- a/src/dir_scan.c +++ b/src/dir_scan.c @@ -137,8 +137,8 @@ static void stat_to_dir(struct stat *fs) { buf_ext->mode = fs->st_mode; buf_ext->mtime = fs->st_mtime; - buf_ext->uid = (int)fs->st_uid; - buf_ext->gid = (int)fs->st_gid; + buf_ext->uid = (unsigned int)fs->st_uid; + buf_ext->gid = (unsigned int)fs->st_gid; buf_ext->flags = FFE_MTIME | FFE_UID | FFE_GID | FFE_MODE; } diff --git a/src/global.h b/src/global.h index 985a4a6..f7e81f5 100644 --- a/src/global.h +++ b/src/global.h @@ -94,7 +94,7 @@ struct dir { * macros to help manage this. */ struct dir_ext { uint64_t mtime; - int uid, gid; + unsigned int uid, gid; unsigned short mode; unsigned char flags; };