bcmp collided with C library routine
[unix-history] / usr / src / usr.bin / chpass / field.c
index 8b46dda..f0b8027 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)field.c    5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)field.c    5.8 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -35,7 +35,7 @@ p_login(p, pw, ep)
        struct entry *ep;
 {
        if (!*p) {
        struct entry *ep;
 {
        if (!*p) {
-               (void)fprintf(stderr, "chpass: empty login field");
+               (void)fprintf(stderr, "chpass: empty login field.\n");
                return(1);
        }
        if (*p == '-') {
                return(1);
        }
        if (*p == '-') {
@@ -44,7 +44,7 @@ p_login(p, pw, ep)
                return(1);
        }
        if (!(pw->pw_name = strdup(p))) {
                return(1);
        }
        if (!(pw->pw_name = strdup(p))) {
-               (void)fprintf(stderr, "chpass: can't save entry");
+               (void)fprintf(stderr, "chpass: can't save entry.\n");
                return(1);
        }
        if (index(p, '.'))
                return(1);
        }
        if (index(p, '.'))
@@ -68,7 +68,7 @@ p_passwd(p, pw, ep)
        if (!*p)
                pw->pw_passwd = "";     /* "NOLOGIN"; */
        else if (!(pw->pw_passwd = strdup(p))) {
        if (!*p)
                pw->pw_passwd = "";     /* "NOLOGIN"; */
        else if (!(pw->pw_passwd = strdup(p))) {
-               (void)fprintf(stderr, "chpass: can't save password entry");
+               (void)fprintf(stderr, "chpass: can't save password entry.\n");
                return(1);
        }
        
                return(1);
        }
        
@@ -84,16 +84,16 @@ p_uid(p, pw, ep)
        int id;
 
        if (!*p) {
        int id;
 
        if (!*p) {
-               (void)fprintf(stderr, "chpass: empty uid field");
+               (void)fprintf(stderr, "chpass: empty uid field.\n");
                return(1);
        }
        if (!isdigit(*p)) {
                return(1);
        }
        if (!isdigit(*p)) {
-               (void)fprintf(stderr, "chpass: illegal uid");
+               (void)fprintf(stderr, "chpass: illegal uid.\n");
                return(1);
        }
        id = atoi(p);
        if ((u_int)id > USHRT_MAX) {
                return(1);
        }
        id = atoi(p);
        if ((u_int)id > USHRT_MAX) {
-               (void)fprintf(stderr, "chpass: %d > max uid value (%d)",
+               (void)fprintf(stderr, "chpass: %d > max uid value (%d).\n",
                    id, USHRT_MAX);
                return(1);
        }
                    id, USHRT_MAX);
                return(1);
        }
@@ -111,12 +111,13 @@ p_gid(p, pw, ep)
        int id;
 
        if (!*p) {
        int id;
 
        if (!*p) {
-               (void)fprintf(stderr, "chpass: empty gid field");
+               (void)fprintf(stderr, "chpass: empty gid field.\n");
                return(1);
        }
        if (!isdigit(*p)) {
                if (!(gr = getgrnam(p))) {
                return(1);
        }
        if (!isdigit(*p)) {
                if (!(gr = getgrnam(p))) {
-                       (void)fprintf(stderr, "chpass: unknown group %s", p);
+                       (void)fprintf(stderr,
+                           "chpass: unknown group %s.\n", p);
                        return(1);
                }
                pw->pw_gid = gr->gr_gid;
                        return(1);
                }
                pw->pw_gid = gr->gr_gid;
@@ -124,7 +125,7 @@ p_gid(p, pw, ep)
        }
        id = atoi(p);
        if ((u_int)id > USHRT_MAX) {
        }
        id = atoi(p);
        if ((u_int)id > USHRT_MAX) {
-               (void)fprintf(stderr, "chpass: %d > max gid value (%d)",
+               (void)fprintf(stderr, "chpass: %d > max gid value (%d).\n",
                    id, USHRT_MAX);
                return(1);
        }
                    id, USHRT_MAX);
                return(1);
        }
@@ -141,7 +142,7 @@ p_class(p, pw, ep)
        if (!*p)
                pw->pw_class = "";
        else if (!(pw->pw_class = strdup(p))) {
        if (!*p)
                pw->pw_class = "";
        else if (!(pw->pw_class = strdup(p))) {
-               (void)fprintf(stderr, "chpass: can't save entry");
+               (void)fprintf(stderr, "chpass: can't save entry.\n");
                return(1);
        }
        
                return(1);
        }
        
@@ -156,7 +157,7 @@ p_change(p, pw, ep)
 {
        if (!atot(p, &pw->pw_change))
                return(0);
 {
        if (!atot(p, &pw->pw_change))
                return(0);
-       (void)fprintf(stderr, "chpass: illegal date for change field");
+       (void)fprintf(stderr, "chpass: illegal date for change field.\n");
        return(1);
 }
 
        return(1);
 }
 
@@ -168,7 +169,7 @@ p_expire(p, pw, ep)
 {
        if (!atot(p, &pw->pw_expire))
                return(0);
 {
        if (!atot(p, &pw->pw_expire))
                return(0);
-       (void)fprintf(stderr, "chpass: illegal date for expire field");
+       (void)fprintf(stderr, "chpass: illegal date for expire field.\n");
        return(1);
 }
 
        return(1);
 }
 
@@ -181,7 +182,7 @@ p_gecos(p, pw, ep)
        if (!*p)
                ep->save = "";
        else if (!(ep->save = strdup(p))) {
        if (!*p)
                ep->save = "";
        else if (!(ep->save = strdup(p))) {
-               (void)fprintf(stderr, "chpass: can't save entry");
+               (void)fprintf(stderr, "chpass: can't save entry.\n");
                return(1);
        }
        return(0);
                return(1);
        }
        return(0);
@@ -194,11 +195,11 @@ p_hdir(p, pw, ep)
        struct entry *ep;
 {
        if (!*p) {
        struct entry *ep;
 {
        if (!*p) {
-               (void)fprintf(stderr, "chpass: empty home directory field");
+               (void)fprintf(stderr, "chpass: empty home directory field.\n");
                return(1);
        }
        if (!(pw->pw_dir = strdup(p))) {
                return(1);
        }
        if (!(pw->pw_dir = strdup(p))) {
-               (void)fprintf(stderr, "chpass: can't save entry");
+               (void)fprintf(stderr, "chpass: can't save entry.\n");
                return(1);
        }
        return(0);
                return(1);
        }
        return(0);
@@ -224,7 +225,7 @@ p_shell(p, pw, ep)
                        if (!uid)
                                break;
                        (void)fprintf(stderr,
                        if (!uid)
                                break;
                        (void)fprintf(stderr,
-                           "chpass: %s: non-standard shell", p);
+                           "chpass: %s: non-standard shell.\n", p);
                        return(1);
                }
                if (!strcmp(p, sh))
                        return(1);
                }
                if (!strcmp(p, sh))
@@ -236,7 +237,7 @@ p_shell(p, pw, ep)
                }
        }
        if (!(pw->pw_shell = strdup(p))) {
                }
        }
        if (!(pw->pw_shell = strdup(p))) {
-               (void)fprintf(stderr, "chpass: can't save entry");
+               (void)fprintf(stderr, "chpass: can't save entry.\n");
                return(1);
        }
        return(0);
                return(1);
        }
        return(0);