]> git.ipfire.org Git - thirdparty/shadow.git/commit
src/chfn.c: Simplify checking for a long GECOS field
authorAlejandro Colomar <alx@kernel.org>
Sat, 19 Jul 2025 08:48:06 +0000 (10:48 +0200)
committerSerge Hallyn <serge@hallyn.com>
Sat, 9 Aug 2025 23:00:36 +0000 (18:00 -0500)
commitd4b0418b4bf86787bfd8692fb2328fe39c1105a8
treeacc5620f93a75e9b45dfed480cd2169d2b0c862d
parent46ffafc8c830f3cd23c959aba2099929aef7c748
src/chfn.c: Simplify checking for a long GECOS field

Use a buffer of the exact size we want, and let SNPRINTF() decide if it
fits or not.

BTW, the old check seemed to be wrong: it wasn't accounting for the
commas in the 80-character limit, but that didn't make much sense.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/chfn.c