]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/chkname.c: Use tmp variable to avoid a -Wsign-compare warning
authorAlejandro Colomar <alx@kernel.org>
Sat, 2 Sep 2023 12:15:43 +0000 (14:15 +0200)
committerAlejandro Colomar <alx@kernel.org>
Sun, 4 Feb 2024 23:40:18 +0000 (00:40 +0100)
commit4b775cbff9a8dc1b34a630dec493161e7a4cc716
treeec15b335c82c2e8149d2af63a444600f7a45d235
parentbc2cc1106d69e15d77aa9876c6834f9c7772532e
lib/chkname.c: Use tmp variable to avoid a -Wsign-compare warning

I used size_t because:

sysconf(3) can return -1 if the value is not supported, but then it can
only mean that there's no limit.  Having no limit is the same as having
a limit of SIZE_MAX (to which -1 is converted).

Signed-off-by: Alejandro Colomar <alx@kernel.org>
Cherry-picked-from: 6be85b0bafb5 ("lib/chkname.c: Use tmp variable to avoid a -Wsign-compare warning")
[alx: This is to cherry-pick the next commit without conflict]
Link: <https://github.com/shadow-maint/shadow/pull/801>
Link: <https://github.com/shadow-maint/shadow/pull/935>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/chkname.c