Fix unsigned comparison warnings in chown()
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 30 Dec 2025 08:58:00 +0000 (09:58 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 31 Dec 2025 11:11:25 +0000 (12:11 +0100)
commit9772731ad9281081b890d5875747bfad1f87ec98
tree6b28f5e4c7e6d62c598b70e55c44cb9bba792a46
parent402cb5a1379a3392f73effe9e0155f5dd152ab52
Fix unsigned comparison warnings in chown()

Original warnings:
src/filefunc.cpp:756:12: error: comparison of unsigned expression in '< 0' is always false [-Werror=type-limits]
src/filefunc.cpp:758:12: error: comparison of unsigned expression in '< 0' is always false [-Werror=type-limits]
src/filefunc.cpp:759:12: error: comparison of unsigned expression in '< 0' is always false [-Werror=type-limits]

The uid_t and gid_t types are unsigned, so comparisons like 'uid < 0' are always false.
Changed to use static_cast<uid_t>(-1) and static_cast<gid_t>(-1) to check for sentinel values.
src/filefunc.cpp