]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/: Use strisdigit() instead of its pattern
authorAlejandro Colomar <alx@kernel.org>
Tue, 10 Dec 2024 15:24:33 +0000 (16:24 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sun, 16 Feb 2025 22:12:16 +0000 (16:12 -0600)
commit77eb67d4a83600febf326b4551949ce5e71e5a34
treec1688e0234b86a47cbab3ef5ccde6ca49bf1ff2e
parent79142cd28173e3d089581366c809957552b40900
lib/: Use strisdigit() instead of its pattern

Note that the old code in

(1)  lib/strtoday.c:strtoday()
(2)  lib/subordinateio.c:append_uids()

was considering an empty string as if it were a number.
strisdigit() does not consider an empty string to be numeric.

I think it will not affect the behavior in either case, as they should
sooner or later result in an error somewhere.  And it seems (IMO)
surprising to treat empty strings as numeric strings, so let's not do
it.

Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/chkname.c
lib/strtoday.c
lib/subordinateio.c