file reorg, pathnames.h, paths.h
[unix-history] / usr / src / usr.bin / chpass / util.c
index 1a9bfae..bb1eedd 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)util.c     5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)util.c     5.10 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -24,9 +24,9 @@ static char sccsid[] = "@(#)util.c    5.6 (Berkeley) %G%";
 #include <tzfile.h>
 #include <pwd.h>
 #include <stdio.h>
 #include <tzfile.h>
 #include <pwd.h>
 #include <stdio.h>
-#include <chpass.h>
 #include <strings.h>
 #include <ctype.h>
 #include <strings.h>
 #include <ctype.h>
+#include "chpass.h"
 #include "pathnames.h"
 
 static int dmsize[] =
 #include "pathnames.h"
 
 static int dmsize[] =
@@ -40,7 +40,7 @@ ttoa(tval)
        time_t tval;
 {
        struct tm *tp;
        time_t tval;
 {
        struct tm *tp;
-       static char tbuf[10];
+       static char tbuf[50];
 
        if (tval) {
                tp = localtime(&tval);
 
        if (tval) {
                tp = localtime(&tval);
@@ -95,11 +95,11 @@ bad:                return(1);
        tval = isleap(year) && month > 2;
        for (--year; year >= EPOCH_YEAR; --year)
                tval += isleap(year) ?
        tval = isleap(year) && month > 2;
        for (--year; year >= EPOCH_YEAR; --year)
                tval += isleap(year) ?
-                   DAYS_PER_LYEAR : DAYS_PER_NYEAR;
+                   DAYSPERLYEAR : DAYSPERNYEAR;
        while (--month)
                tval += dmsize[month];
        while (--month)
                tval += dmsize[month];
-       tval += day - 1;
-       tval = tval * HOURS_PER_DAY * MINS_PER_HOUR * SECS_PER_MIN;
+       tval += day;
+       tval = tval * HOURSPERDAY * MINSPERHOUR * SECSPERMIN;
        tval -= lt->tm_gmtoff;
        *store = tval;
        return(0);
        tval -= lt->tm_gmtoff;
        *store = tval;
        return(0);
@@ -112,7 +112,7 @@ print(fp, pw)
        register char *p;
        char *getusershell(), *ttoa();
 
        register char *p;
        char *getusershell(), *ttoa();
 
-       fprintf(fp, "Changing user database information for %s.\n",
+       fprintf(fp, "#Changing user database information for %s.\n",
            pw->pw_name);
        if (!uid) {
                fprintf(fp, "Login: %s\n", pw->pw_name);
            pw->pw_name);
        if (!uid) {
                fprintf(fp, "Login: %s\n", pw->pw_name);