2.10BSD long/int problems
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 30 Mar 1988 01:14:41 +0000 (17:14 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 30 Mar 1988 01:14:41 +0000 (17:14 -0800)
SCCS-vsn: libexec/comsat/comsat.c 5.11

usr/src/libexec/comsat/comsat.c

index 6b64642..277b482 100644 (file)
@@ -17,7 +17,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)comsat.c   5.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)comsat.c   5.11 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -132,7 +132,7 @@ onalrm()
                        }
                }
                (void)lseek(uf, 0L, L_SET);
                        }
                }
                (void)lseek(uf, 0L, L_SET);
-               nutmp = read(uf, utmp, statbf.st_size)/sizeof(struct utmp);
+               nutmp = read(uf, utmp, (int)statbf.st_size)/sizeof(struct utmp);
        }
 }
 
        }
 }
 
@@ -141,7 +141,7 @@ mailfor(name)
 {
        register struct utmp *utp = &utmp[nutmp];
        register char *cp;
 {
        register struct utmp *utp = &utmp[nutmp];
        register char *cp;
-       int offset;
+       off_t offset, atol();
 
        if (!(cp = index(name, '@')))
                return;
 
        if (!(cp = index(name, '@')))
                return;
@@ -156,7 +156,7 @@ static char *cr;
 
 notify(utp, offset)
        register struct utmp *utp;
 
 notify(utp, offset)
        register struct utmp *utp;
-       int offset;
+       off_t offset;
 {
        static char tty[20] = "/dev/";
        struct sgttyb gttybuf;
 {
        static char tty[20] = "/dev/";
        struct sgttyb gttybuf;
@@ -192,7 +192,7 @@ notify(utp, offset)
 jkfprintf(tp, name, offset)
        register FILE *tp;
        char name[];
 jkfprintf(tp, name, offset)
        register FILE *tp;
        char name[];
-       int offset;
+       off_t offset;
 {
        register char *cp;
        register FILE *fi;
 {
        register char *cp;
        register FILE *fi;
@@ -202,7 +202,7 @@ jkfprintf(tp, name, offset)
 
        if ((fi = fopen(name, "r")) == NULL)
                return;
 
        if ((fi = fopen(name, "r")) == NULL)
                return;
-       (void)fseek(fi, (long)offset, L_SET);
+       (void)fseek(fi, offset, L_SET);
        /* 
         * Print the first 7 lines or 560 characters of the new mail
         * (whichever comes first).  Skip header crap other than
        /* 
         * Print the first 7 lines or 560 characters of the new mail
         * (whichever comes first).  Skip header crap other than