From: Alejandro Colomar Date: Sat, 7 Dec 2024 22:29:58 +0000 (+0100) Subject: lib/sgetpwent.c: sgetpwent(): Trim the trailing '\n' X-Git-Tag: 4.18.0-rc1~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5bff501515e1d795656c2ddb2627d20fb5765dd7;p=thirdparty%2Fshadow.git lib/sgetpwent.c: sgetpwent(): Trim the trailing '\n' Just like the other sget*ent() functions do. Signed-off-by: Alejandro Colomar --- diff --git a/lib/sgetpwent.c b/lib/sgetpwent.c index 61e1e4ed8..691979a19 100644 --- a/lib/sgetpwent.c +++ b/lib/sgetpwent.c @@ -22,6 +22,7 @@ #include "prototypes.h" #include "shadowlog_internal.h" #include "string/strcmp/streq.h" +#include "string/strtok/stpsep.h" #define NFIELDS 7 @@ -52,6 +53,8 @@ sgetpwent(const char *s) if (dup == NULL) return NULL; + stpsep(dup, "\n"); + /* * Save a pointer to the start of each colon separated * field. The fields are converted into NUL terminated strings.