]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
src/chfn.c: Use stpsep() instead of its pattern
authorAlejandro Colomar <alx@kernel.org>
Mon, 17 Feb 2025 12:40:02 +0000 (13:40 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sun, 2 Mar 2025 22:08:19 +0000 (16:08 -0600)
Tested-by: Chris Hofstaedtler <zeha@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/chfn.c

index f06cb4495a4d83b0615fc159b62da9eccf5ab0f4..1799d6b7cc988a142666e80cffc897835441a1b4 100644 (file)
@@ -36,6 +36,7 @@
 #include "string/strcmp/streq.h"
 #include "string/strcpy/strtcpy.h"
 #include "string/strdup/xstrdup.h"
+#include "string/strtok/stpsep.h"
 
 
 /*
@@ -219,10 +220,7 @@ static char *copy_field (char *in, char *out, char *extra)
        char *cp = NULL;
 
        while (NULL != in) {
-               cp = strchr (in, ',');
-               if (NULL != cp) {
-                       *cp++ = '\0';
-               }
+               cp = stpsep(in, ",");
 
                if (strchr (in, '=') == NULL) {
                        break;