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.