Eliminate uses of some obsolete functions.

This commit is contained in:
mycroft 1994-09-23 14:26:58 +00:00
parent 06f53b6838
commit ea7b5d4ec6
58 changed files with 349 additions and 387 deletions

View File

@ -43,7 +43,7 @@ static char copyright[] =
#ifndef lint
/* from static char sccsid[] = "@(#)disklabel.c 1.2 (Symmetric) 11/28/85"; */
/* from static char sccsid[] = "@(#)disklabel.c 8.2 (Berkeley) 1/7/94"; */
static char rcsid[] = "$Id: disklabel.c,v 1.16 1994/09/22 22:03:57 mycroft Exp $";
static char rcsid[] = "$Id: disklabel.c,v 1.17 1994/09/23 14:26:58 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -363,7 +363,7 @@ makelabel(type, name, lp)
#endif
#endif
/* d_packname is union d_boot[01], so zero */
bzero(lp->d_packname, sizeof(lp->d_packname));
memset(lp->d_packname, 0, sizeof(lp->d_packname));
if (name)
(void)strncpy(lp->d_packname, name, sizeof(lp->d_packname));
}
@ -519,7 +519,7 @@ readmbr(f)
if (read(f, mbr, sizeof(mbr)) < sizeof(mbr))
err(4, "can't read master boot record");
bcopy(mbr + DOSPARTOFF, dos_partitions, sizeof(dos_partitions));
memcpy(dos_partitions, mbr + DOSPARTOFF, sizeof(dos_partitions));
/*
* Don't (yet) know disk geometry (BIOS), use
@ -619,7 +619,7 @@ makebootarea(boot, dp, f)
}
lp = (struct disklabel *)
(boot + (LABELSECTOR * dp->d_secsize) + LABELOFFSET);
bzero((char *)lp, sizeof *lp);
memset(lp, 0, sizeof *lp);
#if NUMBOOT > 0
/*
* If we are not installing a boot program but we are installing a
@ -630,7 +630,7 @@ makebootarea(boot, dp, f)
if (rflag) {
if (read(f, boot, BBSIZE) < BBSIZE)
err(4, "%s", specname);
bzero((char *)lp, sizeof *lp);
memset(lp, 0, sizeof *lp);
}
return (lp);
}
@ -640,7 +640,7 @@ makebootarea(boot, dp, f)
*/
if (!xxboot || !bootxx) {
dkbasename = np;
if ((p = rindex(dkname, '/')) == NULL)
if ((p = strrchr(dkname, '/')) == NULL)
p = dkname;
else
p++;
@ -842,7 +842,7 @@ edit(lp, f)
warn("%s", tmpfil);
break;
}
bzero((char *)&label, sizeof(label));
memset(&label, 0, sizeof(label));
if (getasciilabel(fd, &label)) {
*lp = label;
if (writelabel(f, bootarea, lp) == 0) {
@ -941,12 +941,12 @@ getasciilabel(f, lp)
lp->d_sbsize = SBSIZE; /* XXX */
while (fgets(line, sizeof(line) - 1, f)) {
lineno++;
if (cp = index(line,'\n'))
if (cp = strchr(line,'\n'))
*cp = '\0';
cp = skip(line);
if (cp == NULL)
continue;
tp = index(cp, ':');
tp = strchr(cp, ':');
if (tp == NULL) {
warnx("line %d: syntax error", lineno);
errors++;

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)dump.h 8.1 (Berkeley) 6/5/93
* $Id: dump.h,v 1.7 1994/06/08 18:57:33 mycroft Exp $
* $Id: dump.h,v 1.8 1994/09/23 14:27:02 mycroft Exp $
*/
#define MAXINOPB (MAXBSIZE / sizeof(struct dinode))
@ -185,8 +185,9 @@ void sig __P((int signo));
*/
#ifdef COMPAT
#include <sys/file.h>
extern char *index(), *rindex(), *strdup();
extern char *ctime();
#define strchr(a,b) index(a,b)
#define strrchr(a,b) rindex(a,b)
extern char *strdup(), *ctime();
extern int read(), write();
extern int errno;
#endif

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)dumprmt.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: dumprmt.c,v 1.7 1994/09/23 02:18:33 mycroft Exp $";
static char *rcsid = "$Id: dumprmt.c,v 1.8 1994/09/23 14:27:03 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -131,7 +131,7 @@ rmtgetconn()
if (pwd == NULL)
errx(1, "who are you?");
}
if ((cp = index(rmtpeer, '@')) != NULL) {
if ((cp = strchr(rmtpeer, '@')) != NULL) {
tuser = rmtpeer;
*cp = '\0';
if (!okname(tuser))

View File

@ -39,7 +39,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)main.c 8.4 (Berkeley) 4/15/94";*/
static char *rcsid = "$Id: main.c,v 1.3 1994/06/08 18:57:36 mycroft Exp $";
static char *rcsid = "$Id: main.c,v 1.4 1994/09/23 14:27:04 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -244,9 +244,9 @@ main(argc, argv)
tsize = cartridge ? 1700L*120L : 2300L*120L;
}
if (index(tape, ':')) {
if (strchr(tape, ':')) {
host = tape;
tape = index(host, ':');
tape = strchr(host, ':');
*tape++ = '\0';
#ifdef RDUMP
if (rmthost(host) == 0)
@ -533,7 +533,7 @@ rawname(cp)
char *cp;
{
static char rawbuf[MAXPATHLEN];
char *dp = rindex(cp, '/');
char *dp = strrchr(cp, '/');
if (dp == NULL)
return (NULL);

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)tape.c 8.2 (Berkeley) 3/17/94";*/
static char *rcsid = "$Id: tape.c,v 1.3 1994/06/08 18:57:40 mycroft Exp $";
static char *rcsid = "$Id: tape.c,v 1.4 1994/09/23 14:27:06 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -585,10 +585,10 @@ restore_check_point:
* the remaining names for subsequent volumes.
*/
tapeno++; /* current tape sequence */
if (nexttape || index(tape, ',')) {
if (nexttape || strchr(tape, ',')) {
if (nexttape && *nexttape)
tape = nexttape;
if ((p = index(tape, ',')) != NULL) {
if ((p = strchr(tape, ',')) != NULL) {
*p = '\0';
nexttape = p + 1;
} else

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)traverse.c 8.2 (Berkeley) 9/23/93";*/
static char *rcsid = "$Id: traverse.c,v 1.6 1994/09/17 23:59:03 mycroft Exp $";
static char *rcsid = "$Id: traverse.c,v 1.7 1994/09/23 14:27:08 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -372,8 +372,7 @@ dumpino(dp, ino)
spcl.c_addr[0] = 1;
spcl.c_count = 1;
writeheader(ino);
bcopy((caddr_t)dp->di_shortlink, buf,
(u_long)dp->di_size);
memcpy(buf, dp->di_shortlink, (u_long)dp->di_size);
buf[dp->di_size] = '\0';
writerec(buf, 0);
return;
@ -427,7 +426,7 @@ dmpindir(ino, blk, ind_level, size)
if (blk != 0)
bread(fsbtodb(sblock, blk), (char *)idblk, (int) sblock->fs_bsize);
else
bzero((char *)idblk, (int)sblock->fs_bsize);
memset(idblk, 0, (int)sblock->fs_bsize);
if (ind_level <= 0) {
if (*size < NINDIR(sblock) * sblock->fs_bsize)
cnt = howmany(*size, sblock->fs_fsize);
@ -600,7 +599,7 @@ loop:
/*
* Zero buffer, then try to read each sector of buffer separately.
*/
bzero(buf, size);
memset(buf, 0, size);
for (i = 0; i < size; i += dev_bsize, buf += dev_bsize, blkno++) {
if ((int)lseek(diskfd, ((off_t)blkno << dev_bshift), 0) < 0)
msg("bread: lseek2 fails!\n");

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)dir.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: dir.c,v 1.10 1994/09/20 23:31:39 mycroft Exp $";
static char *rcsid = "$Id: dir.c,v 1.11 1994/09/23 14:27:11 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -110,7 +110,7 @@ dirscan(idesc)
idesc->id_loc = 0;
for (dp = fsck_readdir(idesc); dp != NULL; dp = fsck_readdir(idesc)) {
dsize = dp->d_reclen;
bcopy((char *)dp, dbuf, (size_t)dsize);
memcpy(dbuf, dp, (size_t)dsize);
# if (BYTE_ORDER == LITTLE_ENDIAN)
if (!newinofmt) {
struct direct *tdp = (struct direct *)dbuf;
@ -135,7 +135,7 @@ dirscan(idesc)
}
# endif
bp = getdirblk(idesc->id_blkno, blksiz);
bcopy(dbuf, bp->b_un.b_buf + idesc->id_loc - dsize,
memcpy(bp->b_un.b_buf + idesc->id_loc - dsize, dbuf,
(size_t)dsize);
dirty(bp);
sbdirty();
@ -335,7 +335,7 @@ mkentry(idesc)
dirp->d_type = 0;
dirp->d_reclen = newent.d_reclen;
dirp->d_namlen = newent.d_namlen;
bcopy(idesc->id_name, dirp->d_name, (size_t)dirp->d_namlen + 1);
memcpy(dirp->d_name, idesc->id_name, (size_t)dirp->d_namlen + 1);
# if (BYTE_ORDER == LITTLE_ENDIAN)
/*
* If the entry was split, dirscan() will only reverse the byte
@ -380,7 +380,7 @@ linkup(orphan, parentdir)
char tempname[BUFSIZ];
extern int pass4check();
bzero((char *)&idesc, sizeof(struct inodesc));
memset(&idesc, 0, sizeof(struct inodesc));
dp = ginode(orphan);
lostdir = (dp->di_mode & IFMT) == IFDIR;
pwarn("UNREF %s ", lostdir ? "DIR" : "FILE");
@ -483,7 +483,7 @@ changeino(dir, name, newnum)
{
struct inodesc idesc;
bzero((char *)&idesc, sizeof(struct inodesc));
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = DATA;
idesc.id_func = chgino;
idesc.id_number = dir;
@ -507,7 +507,7 @@ makeentry(parent, ino, name)
if (parent < ROOTINO || parent >= maxino ||
ino < ROOTINO || ino >= maxino)
return (0);
bzero((char *)&idesc, sizeof(struct inodesc));
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = DATA;
idesc.id_func = mkentry;
idesc.id_number = parent;
@ -552,21 +552,21 @@ expanddir(dp, name)
(long)dblksize(&sblock, dp, lastbn + 1));
if (bp->b_errs)
goto bad;
bcopy(bp->b_un.b_buf, firstblk, DIRBLKSIZ);
memcpy(firstblk, bp->b_un.b_buf, DIRBLKSIZ);
bp = getdirblk(newblk, sblock.fs_bsize);
if (bp->b_errs)
goto bad;
bcopy(firstblk, bp->b_un.b_buf, DIRBLKSIZ);
memcpy(bp->b_un.b_buf, firstblk, DIRBLKSIZ);
for (cp = &bp->b_un.b_buf[DIRBLKSIZ];
cp < &bp->b_un.b_buf[sblock.fs_bsize];
cp += DIRBLKSIZ)
bcopy((char *)&emptydir, cp, sizeof emptydir);
memcpy(cp, &emptydir, sizeof emptydir);
dirty(bp);
bp = getdirblk(dp->di_db[lastbn + 1],
(long)dblksize(&sblock, dp, lastbn + 1));
if (bp->b_errs)
goto bad;
bcopy((char *)&emptydir, bp->b_un.b_buf, sizeof emptydir);
memcpy(bp->b_un.b_buf, &emptydir, sizeof emptydir);
pwarn("NO SPACE LEFT IN %s", name);
if (preen)
printf(" (EXPANDED)\n");
@ -610,11 +610,11 @@ allocdir(parent, request, mode)
freeino(ino);
return (0);
}
bcopy((char *)dirp, bp->b_un.b_buf, sizeof(struct dirtemplate));
memcpy(bp->b_un.b_buf, dirp, sizeof(struct dirtemplate));
for (cp = &bp->b_un.b_buf[DIRBLKSIZ];
cp < &bp->b_un.b_buf[sblock.fs_fsize];
cp += DIRBLKSIZ)
bcopy((char *)&emptydir, cp, sizeof emptydir);
memcpy(cp, &emptydir, sizeof emptydir);
dirty(bp);
dp->di_nlink = 2;
inodirty();

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)inode.c 8.4 (Berkeley) 4/18/94";*/
static char *rcsid = "$Id: inode.c,v 1.10 1994/06/14 22:50:40 mycroft Exp $";
static char *rcsid = "$Id: inode.c,v 1.11 1994/09/23 14:27:12 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -320,8 +320,7 @@ cacheino(dp, inumber)
inp->i_number = inumber;
inp->i_isize = dp->di_size;
inp->i_numblks = blks * sizeof(daddr_t);
bcopy((char *)&dp->di_db[0], (char *)&inp->i_blks[0],
(size_t)inp->i_numblks);
memcpy(&inp->i_blks[0], &dp->di_db[0], (size_t)inp->i_numblks);
if (inplast == listmax) {
listmax += 100;
inpsort = (struct inoinfo **)realloc((char *)inpsort,
@ -403,7 +402,7 @@ findname(idesc)
if (dirp->d_ino != idesc->id_parent)
return (KEEPON);
bcopy(dirp->d_name, idesc->id_name, (size_t)dirp->d_namlen + 1);
memcpy(idesc->id_name, dirp->d_name, (size_t)dirp->d_namlen + 1);
return (STOP|FOUND);
}
@ -536,7 +535,7 @@ freeino(ino)
extern int pass4check();
struct dinode *dp;
bzero((char *)&idesc, sizeof(struct inodesc));
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = ADDR;
idesc.id_func = pass4check;
idesc.id_number = ino;

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)pass1.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: pass1.c,v 1.9 1994/06/29 11:01:35 ws Exp $";
static char *rcsid = "$Id: pass1.c,v 1.10 1994/09/23 14:27:14 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -72,7 +72,7 @@ pass1()
/*
* Find all allocated blocks.
*/
bzero((char *)&idesc, sizeof(struct inodesc));
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = ADDR;
idesc.id_func = pass1check;
inumber = 0;
@ -160,8 +160,7 @@ checkinode(inumber, idesc)
inumber, symbuf, (long)dp->di_size);
}
dp = ginode(inumber);
bcopy(symbuf, (caddr_t)dp->di_shortlink,
(long)dp->di_size);
memcpy(dp->di_shortlink, symbuf, (long)dp->di_size);
dp->di_blocks = 0;
inodirty();
}

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)pass1b.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: pass1b.c,v 1.6 1994/06/08 19:00:26 mycroft Exp $";
static char *rcsid = "$Id: pass1b.c,v 1.7 1994/09/23 14:27:15 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -53,7 +53,7 @@ pass1b()
struct inodesc idesc;
ino_t inumber;
bzero((char *)&idesc, sizeof(struct inodesc));
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = ADDR;
idesc.id_func = pass1bcheck;
duphead = duplist;

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)pass2.c 8.2 (Berkeley) 2/27/94";*/
static char *rcsid = "$Id: pass2.c,v 1.6 1994/06/08 19:00:27 mycroft Exp $";
static char *rcsid = "$Id: pass2.c,v 1.7 1994/09/23 14:27:16 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -111,7 +111,7 @@ pass2()
/*
* Check the integrity of each directory.
*/
bzero((char *)&curino, sizeof(struct inodesc));
memset(&curino, 0, sizeof(struct inodesc));
curino.id_type = DATA;
curino.id_func = pass2check;
dp = &dino;
@ -143,11 +143,10 @@ pass2()
dp = &dino;
}
}
bzero((char *)&dino, sizeof(struct dinode));
memset(&dino, 0, sizeof(struct dinode));
dino.di_mode = IFDIR;
dp->di_size = inp->i_isize;
bcopy((char *)&inp->i_blks[0], (char *)&dp->di_db[0],
(size_t)inp->i_numblks);
memcpy(&dp->di_db[0], &inp->i_blks[0], (size_t)inp->i_numblks);
curino.id_number = inp->i_number;
curino.id_parent = inp->i_parent;
(void)ckinode(dp, &curino);
@ -245,17 +244,17 @@ pass2check(idesc)
pfatal("CANNOT FIX, INSUFFICIENT SPACE TO ADD '.'\n");
} else if (dirp->d_reclen < 2 * entrysize) {
proto.d_reclen = dirp->d_reclen;
bcopy((char *)&proto, (char *)dirp, (size_t)entrysize);
memcpy(dirp, &proto, (size_t)entrysize);
if (reply("FIX") == 1)
ret |= ALTERED;
} else {
n = dirp->d_reclen - entrysize;
proto.d_reclen = entrysize;
bcopy((char *)&proto, (char *)dirp, (size_t)entrysize);
memcpy(dirp, &proto, (size_t)entrysize);
idesc->id_entryno++;
lncntp[dirp->d_ino]--;
dirp = (struct direct *)((char *)(dirp) + entrysize);
bzero((char *)dirp, (size_t)n);
memset(dirp, 0, (size_t)n);
dirp->d_reclen = n;
if (reply("FIX") == 1)
ret |= ALTERED;
@ -281,7 +280,7 @@ chk1:
idesc->id_entryno++;
lncntp[dirp->d_ino]--;
dirp = (struct direct *)((char *)(dirp) + n);
bzero((char *)dirp, (size_t)proto.d_reclen);
memset(dirp, 0, (size_t)proto.d_reclen);
dirp->d_reclen = proto.d_reclen;
}
if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") == 0) {
@ -310,7 +309,7 @@ chk1:
inp->i_dotdot = inp->i_parent;
fileerror(inp->i_parent, idesc->id_number, "MISSING '..'");
proto.d_reclen = dirp->d_reclen;
bcopy((char *)&proto, (char *)dirp, (size_t)entrysize);
memcpy(dirp, &proto, (size_t)entrysize);
if (reply("FIX") == 1)
ret |= ALTERED;
}

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)pass4.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: pass4.c,v 1.6 1994/06/08 19:00:29 mycroft Exp $";
static char *rcsid = "$Id: pass4.c,v 1.7 1994/09/23 14:27:17 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -54,7 +54,7 @@ pass4()
struct inodesc idesc;
int n;
bzero((char *)&idesc, sizeof(struct inodesc));
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = ADDR;
idesc.id_func = pass4check;
for (inumber = ROOTINO; inumber <= lastino; inumber++) {

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)pass5.c 8.2 (Berkeley) 2/2/94";*/
static char *rcsid = "$Id: pass5.c,v 1.6 1994/06/08 19:00:30 mycroft Exp $";
static char *rcsid = "$Id: pass5.c,v 1.7 1994/09/23 14:27:18 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -58,7 +58,7 @@ pass5()
register struct cg *newcg = (struct cg *)buf;
struct ocg *ocg = (struct ocg *)buf;
bzero((char *)newcg, (size_t)fs->fs_cgsize);
memset(newcg, 0, (size_t)fs->fs_cgsize);
newcg->cg_niblk = fs->fs_ipg;
if (cvtlevel > 3) {
if (fs->fs_maxcontig < 2 && fs->fs_contigsumsize > 0) {
@ -144,13 +144,13 @@ pass5()
errexit("UNKNOWN ROTATIONAL TABLE FORMAT %d\n",
fs->fs_postblformat);
}
bzero((char *)&idesc[0], sizeof idesc);
memset(&idesc[0], 0, sizeof idesc);
for (i = 0; i < 3; i++) {
idesc[i].id_type = ADDR;
if (doinglevel2)
idesc[i].id_fix = FIX;
}
bzero((char *)&cstotal, sizeof(struct csum));
memset(&cstotal, 0, sizeof(struct csum));
j = blknum(fs, fs->fs_size + fs->fs_frag - 1);
for (i = fs->fs_size; i < j; i++)
setbmap(i);
@ -187,8 +187,8 @@ pass5()
newcg->cg_irotor = cg->cg_irotor;
else
newcg->cg_irotor = 0;
bzero((char *)&newcg->cg_frsum[0], sizeof newcg->cg_frsum);
bzero((char *)&cg_blktot(newcg)[0],
memset(&newcg->cg_frsum[0], 0, sizeof newcg->cg_frsum);
memset(&cg_blktot(newcg)[0], 0,
(size_t)(sumsize + mapsize));
if (fs->fs_postblformat == FS_42POSTBLFMT)
ocg->cg_magic = CG_MAGIC;
@ -283,18 +283,18 @@ pass5()
cs = &fs->fs_cs(fs, c);
if (bcmp((char *)&newcg->cg_cs, (char *)cs, sizeof *cs) != 0 &&
dofix(&idesc[0], "FREE BLK COUNT(S) WRONG IN SUPERBLK")) {
bcopy((char *)&newcg->cg_cs, (char *)cs, sizeof *cs);
memcpy(cs, &newcg->cg_cs, sizeof *cs);
sbdirty();
}
if (doinglevel1) {
bcopy((char *)newcg, (char *)cg, (size_t)fs->fs_cgsize);
memcpy(cg, newcg, (size_t)fs->fs_cgsize);
cgdirty();
continue;
}
if (bcmp(cg_inosused(newcg),
cg_inosused(cg), mapsize) != 0 &&
dofix(&idesc[1], "BLK(S) MISSING IN BIT MAPS")) {
bcopy(cg_inosused(newcg), cg_inosused(cg),
memcpy(cg_inosused(cg), cg_inosused(newcg),
(size_t)mapsize);
cgdirty();
}
@ -302,9 +302,9 @@ pass5()
bcmp((char *)&cg_blktot(newcg)[0],
(char *)&cg_blktot(cg)[0], sumsize) != 0) &&
dofix(&idesc[2], "SUMMARY INFORMATION BAD")) {
bcopy((char *)newcg, (char *)cg, (size_t)basesize);
bcopy((char *)&cg_blktot(newcg)[0],
(char *)&cg_blktot(cg)[0], (size_t)sumsize);
memcpy(cg, newcg, (size_t)basesize);
memcpy(&cg_blktot(cg)[0],
&cg_blktot(newcg)[0], (size_t)sumsize);
cgdirty();
}
}
@ -312,7 +312,7 @@ pass5()
fs->fs_nrpos = savednrpos;
if (bcmp((char *)&cstotal, (char *)&fs->fs_cstotal, sizeof *cs) != 0
&& dofix(&idesc[0], "FREE BLK COUNT(S) WRONG IN SUPERBLK")) {
bcopy((char *)&cstotal, (char *)&fs->fs_cstotal, sizeof *cs);
memcpy(&fs->fs_cstotal, &cstotal, sizeof *cs);
fs->fs_ronly = 0;
fs->fs_fmod = 0;
sbdirty();

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)preen.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: preen.c,v 1.6 1994/06/08 19:00:31 mycroft Exp $";
static char *rcsid = "$Id: preen.c,v 1.7 1994/09/23 14:27:20 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -325,7 +325,7 @@ unrawname(name)
char *dp;
struct stat stb;
if ((dp = rindex(name, '/')) == 0)
if ((dp = strrchr(name, '/')) == 0)
return (name);
if (stat(name, &stb) < 0)
return (name);
@ -344,7 +344,7 @@ rawname(name)
static char rawbuf[32];
char *dp;
if ((dp = rindex(name, '/')) == 0)
if ((dp = strrchr(name, '/')) == 0)
return (0);
*dp = 0;
(void)strcpy(rawbuf, name);

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)setup.c 8.2 (Berkeley) 2/21/94";*/
static char *rcsid = "$Id: setup.c,v 1.11 1994/06/29 11:01:37 ws Exp $";
static char *rcsid = "$Id: setup.c,v 1.12 1994/09/23 14:27:21 mycroft Exp $";
#endif /* not lint */
#define DKTYPENAMES
@ -224,8 +224,7 @@ setup(dev)
dirty(&asblk);
}
if (asblk.b_dirty && !bflag) {
bcopy((char *)&sblock, (char *)&altsblock,
(size_t)sblock.fs_sbsize);
memcpy(&altsblock, &sblock, (size_t)sblock.fs_sbsize);
flush(fswritefd, &asblk);
}
/*
@ -353,11 +352,11 @@ readsb(listerr)
altsblock.fs_optim = sblock.fs_optim;
altsblock.fs_rotdelay = sblock.fs_rotdelay;
altsblock.fs_maxbpg = sblock.fs_maxbpg;
bcopy((char *)sblock.fs_csp, (char *)altsblock.fs_csp,
memcpy(altsblock.fs_csp, sblock.fs_csp,
sizeof sblock.fs_csp);
bcopy((char *)sblock.fs_fsmnt, (char *)altsblock.fs_fsmnt,
memcpy(altsblock.fs_fsmnt, sblock.fs_fsmnt,
sizeof sblock.fs_fsmnt);
bcopy((char *)sblock.fs_sparecon, (char *)altsblock.fs_sparecon,
memcpy(altsblock.fs_sparecon, sblock.fs_sparecon,
sizeof sblock.fs_sparecon);
/*
* The following should not have to be copied.
@ -407,7 +406,7 @@ calcsb(dev, devfd, fs)
register char *cp;
int i;
cp = index(dev, '\0') - 1;
cp = strchr(dev, '\0') - 1;
if (cp == (char *)-1 || (*cp < 'a' || *cp > 'h') && !isdigit(*cp)) {
pfatal("%s: CANNOT FIGURE OUT FILE SYSTEM PARTITION\n", dev);
return (0);
@ -423,7 +422,7 @@ calcsb(dev, devfd, fs)
fstypenames[pp->p_fstype] : "unknown");
return (0);
}
bzero((char *)fs, sizeof(struct fs));
memset(fs, 0, sizeof(struct fs));
fs->fs_fsize = pp->p_fsize;
fs->fs_frag = pp->p_frag;
fs->fs_cpg = pp->p_cpg;

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)utilities.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: utilities.c,v 1.9 1994/06/08 19:00:33 mycroft Exp $";
static char *rcsid = "$Id: utilities.c,v 1.10 1994/09/23 14:27:22 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -281,7 +281,7 @@ bread(fd, buf, blk, size)
if (lseek(fd, offset, 0) < 0)
rwerror("SEEK", blk);
errs = 0;
bzero(buf, (size_t)size);
memset(buf, 0, (size_t)size);
printf("THE FOLLOWING DISK SECTORS COULD NOT BE READ:");
for (cp = buf, i = 0; i < size; i += secsize, cp += secsize) {
if (read(fd, cp, (int)secsize) != secsize) {
@ -399,7 +399,7 @@ getpathname(namebuf, curdir, ino)
return;
}
busy = 1;
bzero((char *)&idesc, sizeof(struct inodesc));
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = DATA;
idesc.id_fix = IGNORE;
cp = &namebuf[MAXPATHLEN - 1];
@ -423,7 +423,7 @@ getpathname(namebuf, curdir, ino)
break;
len = strlen(namebuf);
cp -= len;
bcopy(namebuf, cp, (size_t)len);
memcpy(cp, namebuf, (size_t)len);
*--cp = '/';
if (cp < &namebuf[MAXNAMLEN])
break;
@ -432,7 +432,7 @@ getpathname(namebuf, curdir, ino)
busy = 0;
if (ino != ROOTINO)
*--cp = '?';
bcopy(cp, namebuf, (size_t)(&namebuf[MAXPATHLEN] - cp));
memcpy(namebuf, cp, (size_t)(&namebuf[MAXPATHLEN] - cp));
}
void

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)dir.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: dir.c,v 1.10 1994/09/20 23:31:39 mycroft Exp $";
static char *rcsid = "$Id: dir.c,v 1.11 1994/09/23 14:27:11 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -110,7 +110,7 @@ dirscan(idesc)
idesc->id_loc = 0;
for (dp = fsck_readdir(idesc); dp != NULL; dp = fsck_readdir(idesc)) {
dsize = dp->d_reclen;
bcopy((char *)dp, dbuf, (size_t)dsize);
memcpy(dbuf, dp, (size_t)dsize);
# if (BYTE_ORDER == LITTLE_ENDIAN)
if (!newinofmt) {
struct direct *tdp = (struct direct *)dbuf;
@ -135,7 +135,7 @@ dirscan(idesc)
}
# endif
bp = getdirblk(idesc->id_blkno, blksiz);
bcopy(dbuf, bp->b_un.b_buf + idesc->id_loc - dsize,
memcpy(bp->b_un.b_buf + idesc->id_loc - dsize, dbuf,
(size_t)dsize);
dirty(bp);
sbdirty();
@ -335,7 +335,7 @@ mkentry(idesc)
dirp->d_type = 0;
dirp->d_reclen = newent.d_reclen;
dirp->d_namlen = newent.d_namlen;
bcopy(idesc->id_name, dirp->d_name, (size_t)dirp->d_namlen + 1);
memcpy(dirp->d_name, idesc->id_name, (size_t)dirp->d_namlen + 1);
# if (BYTE_ORDER == LITTLE_ENDIAN)
/*
* If the entry was split, dirscan() will only reverse the byte
@ -380,7 +380,7 @@ linkup(orphan, parentdir)
char tempname[BUFSIZ];
extern int pass4check();
bzero((char *)&idesc, sizeof(struct inodesc));
memset(&idesc, 0, sizeof(struct inodesc));
dp = ginode(orphan);
lostdir = (dp->di_mode & IFMT) == IFDIR;
pwarn("UNREF %s ", lostdir ? "DIR" : "FILE");
@ -483,7 +483,7 @@ changeino(dir, name, newnum)
{
struct inodesc idesc;
bzero((char *)&idesc, sizeof(struct inodesc));
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = DATA;
idesc.id_func = chgino;
idesc.id_number = dir;
@ -507,7 +507,7 @@ makeentry(parent, ino, name)
if (parent < ROOTINO || parent >= maxino ||
ino < ROOTINO || ino >= maxino)
return (0);
bzero((char *)&idesc, sizeof(struct inodesc));
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = DATA;
idesc.id_func = mkentry;
idesc.id_number = parent;
@ -552,21 +552,21 @@ expanddir(dp, name)
(long)dblksize(&sblock, dp, lastbn + 1));
if (bp->b_errs)
goto bad;
bcopy(bp->b_un.b_buf, firstblk, DIRBLKSIZ);
memcpy(firstblk, bp->b_un.b_buf, DIRBLKSIZ);
bp = getdirblk(newblk, sblock.fs_bsize);
if (bp->b_errs)
goto bad;
bcopy(firstblk, bp->b_un.b_buf, DIRBLKSIZ);
memcpy(bp->b_un.b_buf, firstblk, DIRBLKSIZ);
for (cp = &bp->b_un.b_buf[DIRBLKSIZ];
cp < &bp->b_un.b_buf[sblock.fs_bsize];
cp += DIRBLKSIZ)
bcopy((char *)&emptydir, cp, sizeof emptydir);
memcpy(cp, &emptydir, sizeof emptydir);
dirty(bp);
bp = getdirblk(dp->di_db[lastbn + 1],
(long)dblksize(&sblock, dp, lastbn + 1));
if (bp->b_errs)
goto bad;
bcopy((char *)&emptydir, bp->b_un.b_buf, sizeof emptydir);
memcpy(bp->b_un.b_buf, &emptydir, sizeof emptydir);
pwarn("NO SPACE LEFT IN %s", name);
if (preen)
printf(" (EXPANDED)\n");
@ -610,11 +610,11 @@ allocdir(parent, request, mode)
freeino(ino);
return (0);
}
bcopy((char *)dirp, bp->b_un.b_buf, sizeof(struct dirtemplate));
memcpy(bp->b_un.b_buf, dirp, sizeof(struct dirtemplate));
for (cp = &bp->b_un.b_buf[DIRBLKSIZ];
cp < &bp->b_un.b_buf[sblock.fs_fsize];
cp += DIRBLKSIZ)
bcopy((char *)&emptydir, cp, sizeof emptydir);
memcpy(cp, &emptydir, sizeof emptydir);
dirty(bp);
dp->di_nlink = 2;
inodirty();

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)inode.c 8.4 (Berkeley) 4/18/94";*/
static char *rcsid = "$Id: inode.c,v 1.10 1994/06/14 22:50:40 mycroft Exp $";
static char *rcsid = "$Id: inode.c,v 1.11 1994/09/23 14:27:12 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -320,8 +320,7 @@ cacheino(dp, inumber)
inp->i_number = inumber;
inp->i_isize = dp->di_size;
inp->i_numblks = blks * sizeof(daddr_t);
bcopy((char *)&dp->di_db[0], (char *)&inp->i_blks[0],
(size_t)inp->i_numblks);
memcpy(&inp->i_blks[0], &dp->di_db[0], (size_t)inp->i_numblks);
if (inplast == listmax) {
listmax += 100;
inpsort = (struct inoinfo **)realloc((char *)inpsort,
@ -403,7 +402,7 @@ findname(idesc)
if (dirp->d_ino != idesc->id_parent)
return (KEEPON);
bcopy(dirp->d_name, idesc->id_name, (size_t)dirp->d_namlen + 1);
memcpy(idesc->id_name, dirp->d_name, (size_t)dirp->d_namlen + 1);
return (STOP|FOUND);
}
@ -536,7 +535,7 @@ freeino(ino)
extern int pass4check();
struct dinode *dp;
bzero((char *)&idesc, sizeof(struct inodesc));
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = ADDR;
idesc.id_func = pass4check;
idesc.id_number = ino;

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)pass1.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: pass1.c,v 1.9 1994/06/29 11:01:35 ws Exp $";
static char *rcsid = "$Id: pass1.c,v 1.10 1994/09/23 14:27:14 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -72,7 +72,7 @@ pass1()
/*
* Find all allocated blocks.
*/
bzero((char *)&idesc, sizeof(struct inodesc));
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = ADDR;
idesc.id_func = pass1check;
inumber = 0;
@ -160,8 +160,7 @@ checkinode(inumber, idesc)
inumber, symbuf, (long)dp->di_size);
}
dp = ginode(inumber);
bcopy(symbuf, (caddr_t)dp->di_shortlink,
(long)dp->di_size);
memcpy(dp->di_shortlink, symbuf, (long)dp->di_size);
dp->di_blocks = 0;
inodirty();
}

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)pass1b.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: pass1b.c,v 1.6 1994/06/08 19:00:26 mycroft Exp $";
static char *rcsid = "$Id: pass1b.c,v 1.7 1994/09/23 14:27:15 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -53,7 +53,7 @@ pass1b()
struct inodesc idesc;
ino_t inumber;
bzero((char *)&idesc, sizeof(struct inodesc));
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = ADDR;
idesc.id_func = pass1bcheck;
duphead = duplist;

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)pass2.c 8.2 (Berkeley) 2/27/94";*/
static char *rcsid = "$Id: pass2.c,v 1.6 1994/06/08 19:00:27 mycroft Exp $";
static char *rcsid = "$Id: pass2.c,v 1.7 1994/09/23 14:27:16 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -111,7 +111,7 @@ pass2()
/*
* Check the integrity of each directory.
*/
bzero((char *)&curino, sizeof(struct inodesc));
memset(&curino, 0, sizeof(struct inodesc));
curino.id_type = DATA;
curino.id_func = pass2check;
dp = &dino;
@ -143,11 +143,10 @@ pass2()
dp = &dino;
}
}
bzero((char *)&dino, sizeof(struct dinode));
memset(&dino, 0, sizeof(struct dinode));
dino.di_mode = IFDIR;
dp->di_size = inp->i_isize;
bcopy((char *)&inp->i_blks[0], (char *)&dp->di_db[0],
(size_t)inp->i_numblks);
memcpy(&dp->di_db[0], &inp->i_blks[0], (size_t)inp->i_numblks);
curino.id_number = inp->i_number;
curino.id_parent = inp->i_parent;
(void)ckinode(dp, &curino);
@ -245,17 +244,17 @@ pass2check(idesc)
pfatal("CANNOT FIX, INSUFFICIENT SPACE TO ADD '.'\n");
} else if (dirp->d_reclen < 2 * entrysize) {
proto.d_reclen = dirp->d_reclen;
bcopy((char *)&proto, (char *)dirp, (size_t)entrysize);
memcpy(dirp, &proto, (size_t)entrysize);
if (reply("FIX") == 1)
ret |= ALTERED;
} else {
n = dirp->d_reclen - entrysize;
proto.d_reclen = entrysize;
bcopy((char *)&proto, (char *)dirp, (size_t)entrysize);
memcpy(dirp, &proto, (size_t)entrysize);
idesc->id_entryno++;
lncntp[dirp->d_ino]--;
dirp = (struct direct *)((char *)(dirp) + entrysize);
bzero((char *)dirp, (size_t)n);
memset(dirp, 0, (size_t)n);
dirp->d_reclen = n;
if (reply("FIX") == 1)
ret |= ALTERED;
@ -281,7 +280,7 @@ chk1:
idesc->id_entryno++;
lncntp[dirp->d_ino]--;
dirp = (struct direct *)((char *)(dirp) + n);
bzero((char *)dirp, (size_t)proto.d_reclen);
memset(dirp, 0, (size_t)proto.d_reclen);
dirp->d_reclen = proto.d_reclen;
}
if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") == 0) {
@ -310,7 +309,7 @@ chk1:
inp->i_dotdot = inp->i_parent;
fileerror(inp->i_parent, idesc->id_number, "MISSING '..'");
proto.d_reclen = dirp->d_reclen;
bcopy((char *)&proto, (char *)dirp, (size_t)entrysize);
memcpy(dirp, &proto, (size_t)entrysize);
if (reply("FIX") == 1)
ret |= ALTERED;
}

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)pass4.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: pass4.c,v 1.6 1994/06/08 19:00:29 mycroft Exp $";
static char *rcsid = "$Id: pass4.c,v 1.7 1994/09/23 14:27:17 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -54,7 +54,7 @@ pass4()
struct inodesc idesc;
int n;
bzero((char *)&idesc, sizeof(struct inodesc));
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = ADDR;
idesc.id_func = pass4check;
for (inumber = ROOTINO; inumber <= lastino; inumber++) {

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)pass5.c 8.2 (Berkeley) 2/2/94";*/
static char *rcsid = "$Id: pass5.c,v 1.6 1994/06/08 19:00:30 mycroft Exp $";
static char *rcsid = "$Id: pass5.c,v 1.7 1994/09/23 14:27:18 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -58,7 +58,7 @@ pass5()
register struct cg *newcg = (struct cg *)buf;
struct ocg *ocg = (struct ocg *)buf;
bzero((char *)newcg, (size_t)fs->fs_cgsize);
memset(newcg, 0, (size_t)fs->fs_cgsize);
newcg->cg_niblk = fs->fs_ipg;
if (cvtlevel > 3) {
if (fs->fs_maxcontig < 2 && fs->fs_contigsumsize > 0) {
@ -144,13 +144,13 @@ pass5()
errexit("UNKNOWN ROTATIONAL TABLE FORMAT %d\n",
fs->fs_postblformat);
}
bzero((char *)&idesc[0], sizeof idesc);
memset(&idesc[0], 0, sizeof idesc);
for (i = 0; i < 3; i++) {
idesc[i].id_type = ADDR;
if (doinglevel2)
idesc[i].id_fix = FIX;
}
bzero((char *)&cstotal, sizeof(struct csum));
memset(&cstotal, 0, sizeof(struct csum));
j = blknum(fs, fs->fs_size + fs->fs_frag - 1);
for (i = fs->fs_size; i < j; i++)
setbmap(i);
@ -187,8 +187,8 @@ pass5()
newcg->cg_irotor = cg->cg_irotor;
else
newcg->cg_irotor = 0;
bzero((char *)&newcg->cg_frsum[0], sizeof newcg->cg_frsum);
bzero((char *)&cg_blktot(newcg)[0],
memset(&newcg->cg_frsum[0], 0, sizeof newcg->cg_frsum);
memset(&cg_blktot(newcg)[0], 0,
(size_t)(sumsize + mapsize));
if (fs->fs_postblformat == FS_42POSTBLFMT)
ocg->cg_magic = CG_MAGIC;
@ -283,18 +283,18 @@ pass5()
cs = &fs->fs_cs(fs, c);
if (bcmp((char *)&newcg->cg_cs, (char *)cs, sizeof *cs) != 0 &&
dofix(&idesc[0], "FREE BLK COUNT(S) WRONG IN SUPERBLK")) {
bcopy((char *)&newcg->cg_cs, (char *)cs, sizeof *cs);
memcpy(cs, &newcg->cg_cs, sizeof *cs);
sbdirty();
}
if (doinglevel1) {
bcopy((char *)newcg, (char *)cg, (size_t)fs->fs_cgsize);
memcpy(cg, newcg, (size_t)fs->fs_cgsize);
cgdirty();
continue;
}
if (bcmp(cg_inosused(newcg),
cg_inosused(cg), mapsize) != 0 &&
dofix(&idesc[1], "BLK(S) MISSING IN BIT MAPS")) {
bcopy(cg_inosused(newcg), cg_inosused(cg),
memcpy(cg_inosused(cg), cg_inosused(newcg),
(size_t)mapsize);
cgdirty();
}
@ -302,9 +302,9 @@ pass5()
bcmp((char *)&cg_blktot(newcg)[0],
(char *)&cg_blktot(cg)[0], sumsize) != 0) &&
dofix(&idesc[2], "SUMMARY INFORMATION BAD")) {
bcopy((char *)newcg, (char *)cg, (size_t)basesize);
bcopy((char *)&cg_blktot(newcg)[0],
(char *)&cg_blktot(cg)[0], (size_t)sumsize);
memcpy(cg, newcg, (size_t)basesize);
memcpy(&cg_blktot(cg)[0],
&cg_blktot(newcg)[0], (size_t)sumsize);
cgdirty();
}
}
@ -312,7 +312,7 @@ pass5()
fs->fs_nrpos = savednrpos;
if (bcmp((char *)&cstotal, (char *)&fs->fs_cstotal, sizeof *cs) != 0
&& dofix(&idesc[0], "FREE BLK COUNT(S) WRONG IN SUPERBLK")) {
bcopy((char *)&cstotal, (char *)&fs->fs_cstotal, sizeof *cs);
memcpy(&fs->fs_cstotal, &cstotal, sizeof *cs);
fs->fs_ronly = 0;
fs->fs_fmod = 0;
sbdirty();

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)preen.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: preen.c,v 1.6 1994/06/08 19:00:31 mycroft Exp $";
static char *rcsid = "$Id: preen.c,v 1.7 1994/09/23 14:27:20 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -325,7 +325,7 @@ unrawname(name)
char *dp;
struct stat stb;
if ((dp = rindex(name, '/')) == 0)
if ((dp = strrchr(name, '/')) == 0)
return (name);
if (stat(name, &stb) < 0)
return (name);
@ -344,7 +344,7 @@ rawname(name)
static char rawbuf[32];
char *dp;
if ((dp = rindex(name, '/')) == 0)
if ((dp = strrchr(name, '/')) == 0)
return (0);
*dp = 0;
(void)strcpy(rawbuf, name);

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)setup.c 8.2 (Berkeley) 2/21/94";*/
static char *rcsid = "$Id: setup.c,v 1.11 1994/06/29 11:01:37 ws Exp $";
static char *rcsid = "$Id: setup.c,v 1.12 1994/09/23 14:27:21 mycroft Exp $";
#endif /* not lint */
#define DKTYPENAMES
@ -224,8 +224,7 @@ setup(dev)
dirty(&asblk);
}
if (asblk.b_dirty && !bflag) {
bcopy((char *)&sblock, (char *)&altsblock,
(size_t)sblock.fs_sbsize);
memcpy(&altsblock, &sblock, (size_t)sblock.fs_sbsize);
flush(fswritefd, &asblk);
}
/*
@ -353,11 +352,11 @@ readsb(listerr)
altsblock.fs_optim = sblock.fs_optim;
altsblock.fs_rotdelay = sblock.fs_rotdelay;
altsblock.fs_maxbpg = sblock.fs_maxbpg;
bcopy((char *)sblock.fs_csp, (char *)altsblock.fs_csp,
memcpy(altsblock.fs_csp, sblock.fs_csp,
sizeof sblock.fs_csp);
bcopy((char *)sblock.fs_fsmnt, (char *)altsblock.fs_fsmnt,
memcpy(altsblock.fs_fsmnt, sblock.fs_fsmnt,
sizeof sblock.fs_fsmnt);
bcopy((char *)sblock.fs_sparecon, (char *)altsblock.fs_sparecon,
memcpy(altsblock.fs_sparecon, sblock.fs_sparecon,
sizeof sblock.fs_sparecon);
/*
* The following should not have to be copied.
@ -407,7 +406,7 @@ calcsb(dev, devfd, fs)
register char *cp;
int i;
cp = index(dev, '\0') - 1;
cp = strchr(dev, '\0') - 1;
if (cp == (char *)-1 || (*cp < 'a' || *cp > 'h') && !isdigit(*cp)) {
pfatal("%s: CANNOT FIGURE OUT FILE SYSTEM PARTITION\n", dev);
return (0);
@ -423,7 +422,7 @@ calcsb(dev, devfd, fs)
fstypenames[pp->p_fstype] : "unknown");
return (0);
}
bzero((char *)fs, sizeof(struct fs));
memset(fs, 0, sizeof(struct fs));
fs->fs_fsize = pp->p_fsize;
fs->fs_frag = pp->p_frag;
fs->fs_cpg = pp->p_cpg;

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)utilities.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: utilities.c,v 1.9 1994/06/08 19:00:33 mycroft Exp $";
static char *rcsid = "$Id: utilities.c,v 1.10 1994/09/23 14:27:22 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -281,7 +281,7 @@ bread(fd, buf, blk, size)
if (lseek(fd, offset, 0) < 0)
rwerror("SEEK", blk);
errs = 0;
bzero(buf, (size_t)size);
memset(buf, 0, (size_t)size);
printf("THE FOLLOWING DISK SECTORS COULD NOT BE READ:");
for (cp = buf, i = 0; i < size; i += secsize, cp += secsize) {
if (read(fd, cp, (int)secsize) != secsize) {
@ -399,7 +399,7 @@ getpathname(namebuf, curdir, ino)
return;
}
busy = 1;
bzero((char *)&idesc, sizeof(struct inodesc));
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = DATA;
idesc.id_fix = IGNORE;
cp = &namebuf[MAXPATHLEN - 1];
@ -423,7 +423,7 @@ getpathname(namebuf, curdir, ino)
break;
len = strlen(namebuf);
cp -= len;
bcopy(namebuf, cp, (size_t)len);
memcpy(cp, namebuf, (size_t)len);
*--cp = '/';
if (cp < &namebuf[MAXNAMLEN])
break;
@ -432,7 +432,7 @@ getpathname(namebuf, curdir, ino)
busy = 0;
if (ino != ROOTINO)
*--cp = '?';
bcopy(cp, namebuf, (size_t)(&namebuf[MAXPATHLEN] - cp));
memcpy(namebuf, cp, (size_t)(&namebuf[MAXPATHLEN] - cp));
}
void

View File

@ -39,7 +39,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)ifconfig.c 8.2 (Berkeley) 2/16/94";*/
static char *rcsid = "$Id: ifconfig.c,v 1.13 1994/09/23 01:38:52 mycroft Exp $";
static char *rcsid = "$Id: ifconfig.c,v 1.14 1994/09/23 14:27:24 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -371,9 +371,9 @@ notealias(addr, param)
char *addr;
{
if (setaddr && doalias == 0 && param < 0)
bcopy((caddr_t)rqtosa(af_addreq),
(caddr_t)rqtosa(af_ridreq),
rqtosa(af_addreq)->sa_len);
memcpy(rqtosa(af_ridreq),
rqtosa(af_addreq),
rqtosa(af_addreq)->sa_len);
doalias = param;
if (param < 0) {
clearaddr = 1;
@ -470,13 +470,13 @@ in_status(force)
return;
err(1, "socket");
}
bzero((caddr_t)&ifr, sizeof(ifr));
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
if (ioctl(s, SIOCGIFADDR, (caddr_t)&ifr) < 0) {
if (errno == EADDRNOTAVAIL || errno == EAFNOSUPPORT) {
if (!force)
return;
bzero((char *)&ifr.ifr_addr, sizeof(ifr.ifr_addr));
memset(&ifr.ifr_addr, 0, sizeof(ifr.ifr_addr));
} else
warn("SIOCGIFADDR");
}
@ -487,14 +487,14 @@ in_status(force)
if (ioctl(s, SIOCGIFNETMASK, (caddr_t)&ifr) < 0) {
if (errno != EADDRNOTAVAIL)
warn("SIOCGIFNETMASK");
bzero((char *)&ifr.ifr_addr, sizeof(ifr.ifr_addr));
memset(&ifr.ifr_addr, 0, sizeof(ifr.ifr_addr));
} else
netmask.sin_addr =
((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr;
if (flags & IFF_POINTOPOINT) {
if (ioctl(s, SIOCGIFDSTADDR, (caddr_t)&ifr) < 0) {
if (errno == EADDRNOTAVAIL)
bzero((char *)&ifr.ifr_addr, sizeof(ifr.ifr_addr));
memset(&ifr.ifr_addr, 0, sizeof(ifr.ifr_addr));
else
warn("SIOCGIFDSTADDR");
}
@ -506,7 +506,7 @@ in_status(force)
if (flags & IFF_BROADCAST) {
if (ioctl(s, SIOCGIFBRDADDR, (caddr_t)&ifr) < 0) {
if (errno == EADDRNOTAVAIL)
bzero((char *)&ifr.ifr_addr, sizeof(ifr.ifr_addr));
memset(&ifr.ifr_addr, 0, sizeof(ifr.ifr_addr));
else
warn("SIOCGIFBRDADDR");
}
@ -529,13 +529,13 @@ xns_status(force)
return;
err(1, "socket");
}
bzero((caddr_t)&ifr, sizeof(ifr));
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
if (ioctl(s, SIOCGIFADDR, (caddr_t)&ifr) < 0) {
if (errno == EADDRNOTAVAIL || errno == EAFNOSUPPORT) {
if (!force)
return;
bzero((char *)&ifr.ifr_addr, sizeof(ifr.ifr_addr));
memset(&ifr.ifr_addr, 0, sizeof(ifr.ifr_addr));
} else
warn("SIOCGIFADDR");
}
@ -545,7 +545,7 @@ xns_status(force)
if (flags & IFF_POINTOPOINT) { /* by W. Nesheim@Cornell */
if (ioctl(s, SIOCGIFDSTADDR, (caddr_t)&ifr) < 0) {
if (errno == EADDRNOTAVAIL)
bzero((char *)&ifr.ifr_addr, sizeof(ifr.ifr_addr));
memset(&ifr.ifr_addr, 0, sizeof(ifr.ifr_addr));
else
warn("SIOCGIFDSTADDR");
}
@ -568,13 +568,13 @@ iso_status(force)
return;
err(1, "socket");
}
bzero((caddr_t)&ifr, sizeof(ifr));
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
if (ioctl(s, SIOCGIFADDR_ISO, (caddr_t)&ifr) < 0) {
if (errno == EADDRNOTAVAIL || errno == EAFNOSUPPORT) {
if (!force)
return;
bzero((char *)&ifr.ifr_Addr, sizeof(ifr.ifr_Addr));
memset(&ifr.ifr_Addr, 0, sizeof(ifr.ifr_Addr));
} else
warn("SIOCGIFADDR_ISO");
}
@ -583,7 +583,7 @@ iso_status(force)
printf("\tiso %s ", iso_ntoa(&siso->siso_addr));
if (ioctl(s, SIOCGIFNETMASK_ISO, (caddr_t)&ifr) < 0) {
if (errno == EADDRNOTAVAIL)
bzero((char *)&ifr.ifr_Addr, sizeof(ifr.ifr_Addr));
memset(&ifr.ifr_Addr, 0, sizeof(ifr.ifr_Addr));
else
warn("SIOCGIFNETMASK_ISO");
} else {
@ -592,7 +592,7 @@ iso_status(force)
if (flags & IFF_POINTOPOINT) {
if (ioctl(s, SIOCGIFDSTADDR_ISO, (caddr_t)&ifr) < 0) {
if (errno == EADDRNOTAVAIL)
bzero((char *)&ifr.ifr_Addr, sizeof(ifr.ifr_Addr));
memset(&ifr.ifr_Addr, 0, sizeof(ifr.ifr_Addr));
else
warn("SIOCGIFDSTADDR_ISO");
}
@ -625,7 +625,7 @@ in_getaddr(s, which)
if ((val = inet_addr(s)) != -1)
sin->sin_addr.s_addr = val;
else if (hp = gethostbyname(s))
bcopy(hp->h_addr, (char *)&sin->sin_addr, hp->h_length);
memcpy(&sin->sin_addr, hp->h_addr, hp->h_length);
else if (np = getnetbyname(s))
sin->sin_addr = inet_makeaddr(np->n_net, INADDR_ANY);
else

View File

@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)init.c 8.1 (Berkeley) 7/15/93";*/
static char *rcsid = "$Id: init.c,v 1.17 1994/08/06 06:26:44 deraadt Exp $";
static char *rcsid = "$Id: init.c,v 1.18 1994/09/23 14:27:27 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -592,7 +592,7 @@ single_user()
if (clear == 0 || *clear == '\0')
_exit(0);
password = crypt(clear, pp->pw_passwd);
bzero(clear, _PASSWORD_LEN);
memset(clear, 0, _PASSWORD_LEN);
if (strcmp(password, pp->pw_passwd) == 0)
break;
warning("single-user login failed\n");
@ -855,7 +855,7 @@ find_session(pid)
key.size = sizeof pid;
if ((*session_db->get)(session_db, &key, &data, 0) != 0)
return 0;
bcopy(data.data, (char *)&ret, sizeof(ret));
memcpy(&ret, data.data, sizeof(ret));
return ret;
}
@ -914,7 +914,7 @@ new_session(sprev, session_index, typ)
return 0;
sp = (session_t *) malloc(sizeof (session_t));
bzero(sp, sizeof *sp);
memset(sp, 0, sizeof *sp);
sp->se_index = session_index;

View File

@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)mount_nfs.c 8.3 (Berkeley) 3/27/94";*/
static char *rcsid = "$Id: mount_nfs.c,v 1.5 1994/09/17 05:27:11 mycroft Exp $";
static char *rcsid = "$Id: mount_nfs.c,v 1.6 1994/09/23 14:27:30 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -406,14 +406,13 @@ getnfsargs(spec, nfsargsp)
warnx("bad ISO address");
return (0);
}
bzero((caddr_t)&isoaddr, sizeof (isoaddr));
bcopy((caddr_t)isop, (caddr_t)&isoaddr.siso_addr,
sizeof (struct iso_addr));
memset(&isoaddr, 0, sizeof (isoaddr));
memcpy(&isoaddr.siso_addr, isop, sizeof (struct iso_addr));
isoaddr.siso_len = sizeof (isoaddr);
isoaddr.siso_family = AF_ISO;
isoaddr.siso_tlen = 2;
isoport = htons(NFS_PORT);
bcopy((caddr_t)&isoport, TSEL(&isoaddr), isoaddr.siso_tlen);
memcpy(TSEL(&isoaddr), &isoport, isoaddr.siso_tlen);
hostp = delimp + 1;
}
#endif /* ISO */
@ -433,13 +432,13 @@ getnfsargs(spec, nfsargsp)
warnx("can't reverse resolve net address");
return (0);
}
bcopy(hp->h_addr, (caddr_t)&saddr.sin_addr, hp->h_length);
memcpy(&saddr.sin_addr, hp->h_addr, hp->h_length);
}
} else if ((hp = gethostbyname(hostp)) == NULL) {
warnx("can't get net id for host");
return (0);
} else
bcopy(hp->h_addr, (caddr_t)&saddr.sin_addr, hp->h_length);
memcpy(&saddr.sin_addr, hp->h_addr, hp->h_length);
#ifdef KERBEROS
if (nfsargsp->flags & NFSMNT_KERB) {
strncpy(inst, hp->h_name, INST_SZ);

View File

@ -36,7 +36,7 @@
*
* from: Id: activate.c,v 1.2 1992/05/27 07:09:27 jsp Exp
* from: @(#)activate.c 8.2 (Berkeley) 3/27/94
* $Id: activate.c,v 1.2 1994/06/08 19:24:45 mycroft Exp $
* $Id: activate.c,v 1.3 1994/09/23 14:27:33 mycroft Exp $
*/
#include <stdio.h>
@ -89,7 +89,7 @@ int klen;
iov[1].iov_base = key;
iov[1].iov_len = klen;
bzero((char *) &msg, sizeof(msg));
memset(&msg, 0, sizeof(msg));
msg.msg_iov = iov;
msg.msg_iovlen = 2;
@ -129,7 +129,7 @@ int error;
/*
* Build a msghdr
*/
bzero((char *) &msg, sizeof(msg));
memset(&msg, 0, sizeof(msg));
msg.msg_iov = &iov;
msg.msg_iovlen = 1;

View File

@ -36,7 +36,7 @@
*
* from: Id: pt_tcp.c,v 1.1 1992/05/25 21:43:09 jsp Exp
* from: @(#)pt_tcp.c 8.3 (Berkeley) 3/27/94
* $Id: pt_tcp.c,v 1.5 1994/06/08 19:24:56 mycroft Exp $
* $Id: pt_tcp.c,v 1.6 1994/09/23 14:27:34 mycroft Exp $
*/
#include <stdio.h>
@ -127,7 +127,7 @@ int *fdp;
return (EINVAL);
}
bzero(&sain, sizeof(sain));
memset(&sain, 0, sizeof(sain));
sain.sin_len = sizeof(sain);
sain.sin_family = AF_INET;
sain.sin_port = s_port;

View File

@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)mountd.c 8.8 (Berkeley) 2/20/94";*/
static char *rcsid = "$Id: mountd.c,v 1.14 1994/08/12 04:19:52 cgd Exp $";
static char *rcsid = "$Id: mountd.c,v 1.15 1994/09/23 14:27:37 mycroft Exp $";
#endif not lint
#include <sys/param.h>
@ -356,7 +356,7 @@ mntsrv(rqstp, transp)
(defset && scan_tree(ep->ex_defdir, saddr) == 0 &&
scan_tree(ep->ex_dirl, saddr) == 0))) {
/* Get the file handle */
bzero((caddr_t)&nfh, sizeof(nfh));
memset(&nfh, 0, sizeof(nfh));
if (getfh(dirpath, (fhandle_t *)&nfh) < 0) {
bad = errno;
syslog(LOG_ERR, "Can't get fh for %s", dirpath);
@ -879,7 +879,7 @@ get_exp()
ep = (struct exportlist *)malloc(sizeof (struct exportlist));
if (ep == (struct exportlist *)NULL)
out_of_mem();
bzero((caddr_t)ep, sizeof (struct exportlist));
memset(ep, 0, sizeof(struct exportlist));
return (ep);
}
@ -894,7 +894,7 @@ get_grp()
gp = (struct grouplist *)malloc(sizeof (struct grouplist));
if (gp == (struct grouplist *)NULL)
out_of_mem();
bzero((caddr_t)gp, sizeof (struct grouplist));
memset(gp, 0, sizeof(struct grouplist));
return (gp);
}
@ -1171,12 +1171,12 @@ do_opt(cpp, endcpp, ep, grp, has_hostp, exflagsp, cr)
while (cpopt && *cpopt) {
allflag = 1;
usedarg = -2;
if (cpoptend = index(cpopt, ',')) {
if (cpoptend = strchr(cpopt, ',')) {
*cpoptend++ = '\0';
if (cpoptarg = index(cpopt, '='))
if (cpoptarg = strchr(cpopt, '='))
*cpoptarg++ = '\0';
} else {
if (cpoptarg = index(cpopt, '='))
if (cpoptarg = strchr(cpopt, '='))
*cpoptarg++ = '\0';
else {
*cp = savedc;
@ -1302,13 +1302,12 @@ get_host(cp, grp)
malloc(sizeof(struct hostent));
if (nhp == (struct hostent *)NULL)
out_of_mem();
bcopy((caddr_t)hp, (caddr_t)nhp,
sizeof(struct hostent));
memcpy(nhp, hp, sizeof(struct hostent));
i = strlen(hp->h_name)+1;
nhp->h_name = (char *)malloc(i);
if (nhp->h_name == (char *)NULL)
out_of_mem();
bcopy(hp->h_name, nhp->h_name, i);
memcpy(nhp->h_name, hp->h_name, i);
addrp = hp->h_addr_list;
i = 1;
while (*addrp++)
@ -1323,8 +1322,7 @@ get_host(cp, grp)
malloc(hp->h_length);
if (*naddrp == (char *)NULL)
out_of_mem();
bcopy(*addrp, *naddrp,
hp->h_length);
memcpy(*naddrp, *addrp, hp->h_length);
addrp++;
naddrp++;
}
@ -1402,10 +1400,9 @@ get_isoaddr(cp, grp)
malloc(sizeof (struct sockaddr_iso));
if (isoaddr == (struct sockaddr_iso *)NULL)
out_of_mem();
bzero((caddr_t)isoaddr, sizeof (struct sockaddr_iso));
bcopy((caddr_t)isop, (caddr_t)&isoaddr->siso_addr,
sizeof (struct iso_addr));
isoaddr->siso_len = sizeof (struct sockaddr_iso);
memset(isoaddr, 0, sizeof(struct sockaddr_iso));
memcpy(&isoaddr->siso_addr, isop, sizeof(struct iso_addr));
isoaddr->siso_len = sizeof(struct sockaddr_iso);
isoaddr->siso_family = AF_ISO;
grp->gr_type = GT_ISO;
grp->gr_ptr.gt_isoaddr = isoaddr;
@ -1454,8 +1451,8 @@ do_mount(ep, grp, exflags, anoncrp, dirp, dirplen, fsb)
args.ua.fspec = 0;
args.ua.export.ex_flags = exflags;
args.ua.export.ex_anon = *anoncrp;
bzero((char *)&sin, sizeof(sin));
bzero((char *)&imask, sizeof(imask));
memset(&sin, 0, sizeof(sin));
memset(&imask, 0, sizeof(imask));
sin.sin_family = AF_INET;
sin.sin_len = sizeof(sin);
imask.sin_family = AF_INET;
@ -1769,7 +1766,7 @@ void
get_mountlist()
{
struct mountlist *mlp, **mlpp;
char *eos, *dirp;
char *host, *dirp, *cp;
int len;
char str[STRSIZ];
FILE *mlfile;
@ -1780,27 +1777,16 @@ get_mountlist()
}
mlpp = &mlhead;
while (fgets(str, STRSIZ, mlfile) != NULL) {
if ((dirp = index(str, '\t')) == NULL &&
(dirp = index(str, ' ')) == NULL)
cp = str;
host = strsep(&cp, " \t\n");
dirp = strsep(&cp, " \t\n");
if (host == NULL || dirp == NULL)
continue;
mlp = (struct mountlist *)malloc(sizeof (*mlp));
len = dirp-str;
if (len > RPCMNT_NAMELEN)
len = RPCMNT_NAMELEN;
bcopy(str, mlp->ml_host, len);
mlp->ml_host[len] = '\0';
while (*dirp == '\t' || *dirp == ' ')
dirp++;
if ((eos = index(dirp, '\t')) == NULL &&
(eos = index(dirp, ' ')) == NULL &&
(eos = index(dirp, '\n')) == NULL)
len = strlen(dirp);
else
len = eos-dirp;
if (len > RPCMNT_PATHLEN)
len = RPCMNT_PATHLEN;
bcopy(dirp, mlp->ml_dirp, len);
mlp->ml_dirp[len] = '\0';
strncpy(mlp->ml_host, host, RPCMNT_NAMELEN);
mlp->ml_host[RPCMNT_NAMELEN] = '\0';
strncpy(mlp->ml_dirp, dirp, RPCMNT_PATHLEN);
mlp->ml_dirp[RPCMNT_PATHLEN] = '\0';
mlp->ml_next = (struct mountlist *)NULL;
*mlpp = mlp;
mlpp = &mlp->ml_next;

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)mkfs.c 8.3 (Berkeley) 2/3/94";*/
static char *rcsid = "$Id: mkfs.c,v 1.11 1994/07/20 20:31:58 cgd Exp $";
static char *rcsid = "$Id: mkfs.c,v 1.12 1994/09/23 14:27:40 mycroft Exp $";
#endif /* not lint */
#include <unistd.h>
@ -661,7 +661,7 @@ initcg(cylno, utime)
if (cylno == 0)
dupper += howmany(sblock.fs_cssize, sblock.fs_fsize);
cs = fscs + cylno;
bzero(&acg, sblock.fs_cgsize);
memset(&acg, 0, sblock.fs_cgsize);
acg.cg_time = utime;
acg.cg_magic = CG_MAGIC;
acg.cg_cgx = cylno;
@ -848,12 +848,12 @@ fsinit(utime)
if (Oflag) {
(void)makedir((struct direct *)olost_found_dir, 2);
for (i = DIRBLKSIZ; i < sblock.fs_bsize; i += DIRBLKSIZ)
bcopy(&olost_found_dir[2], &buf[i],
memcpy(&buf[i], &olost_found_dir[2],
DIRSIZ(0, &olost_found_dir[2]));
} else {
(void)makedir(lost_found_dir, 2);
for (i = DIRBLKSIZ; i < sblock.fs_bsize; i += DIRBLKSIZ)
bcopy(&lost_found_dir[2], &buf[i],
memcpy(&buf[i], &lost_found_dir[2],
DIRSIZ(0, &lost_found_dir[2]));
}
node.di_mode = IFDIR | UMASK;
@ -896,12 +896,12 @@ makedir(protodir, entries)
spcleft = DIRBLKSIZ;
for (cp = buf, i = 0; i < entries - 1; i++) {
protodir[i].d_reclen = DIRSIZ(0, &protodir[i]);
bcopy(&protodir[i], cp, protodir[i].d_reclen);
memcpy(cp, &protodir[i], protodir[i].d_reclen);
cp += protodir[i].d_reclen;
spcleft -= protodir[i].d_reclen;
}
protodir[i].d_reclen = spcleft;
bcopy(&protodir[i], cp, DIRSIZ(0, &protodir[i]));
memcpy(cp, &protodir[i], DIRSIZ(0, &protodir[i]));
return (DIRBLKSIZ);
}
@ -1048,7 +1048,7 @@ realloc(ptr, size)
if ((p = malloc(size)) == NULL)
return (NULL);
bcopy(ptr, p, size);
memcpy(p, ptr, size);
free(ptr);
return (p);
}
@ -1064,7 +1064,7 @@ calloc(size, numelm)
size *= numelm;
base = malloc(size);
bzero(base, size);
memset(base, 0, size);
return (base);
}
@ -1089,7 +1089,7 @@ rdfs(bno, size, bf)
int n;
if (mfs) {
bcopy(membase + bno * sectorsize, bf, size);
memcpy(bf, membase + bno * sectorsize, size);
return;
}
if (lseek(fsi, (off_t)bno * sectorsize, 0) < 0) {
@ -1116,7 +1116,7 @@ wtfs(bno, size, bf)
int n;
if (mfs) {
bcopy(bf, membase + bno * sectorsize, size);
memcpy(membase + bno * sectorsize, bf, size);
return;
}
if (Nflag)

View File

@ -39,7 +39,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)newfs.c 8.8 (Berkeley) 4/18/94";*/
static char *rcsid = "$Id: newfs.c,v 1.10 1994/06/08 19:30:28 mycroft Exp $";
static char *rcsid = "$Id: newfs.c,v 1.11 1994/09/23 14:27:42 mycroft Exp $";
#endif /* not lint */
/*
@ -196,7 +196,7 @@ main(argc, argv)
int fsi, fso, len, n;
char *cp, *s1, *s2, *special, *opstring, buf[BUFSIZ];
if (progname = rindex(*argv, '/'))
if (progname = strrchr(*argv, '/'))
++progname;
else
progname = *argv;
@ -323,7 +323,7 @@ main(argc, argv)
usage();
special = argv[0];
cp = rindex(special, '/');
cp = strrchr(special, '/');
if (cp == 0) {
/*
* No path prefix; try /dev/r%s then /dev/%s.
@ -376,7 +376,7 @@ main(argc, argv)
if ((st.st_mode & S_IFMT) != S_IFCHR && !mfs)
printf("%s: %s: not a character-special device\n",
progname, special);
cp = index(argv[0], '\0') - 1;
cp = strchr(argv[0], '\0') - 1;
if (cp == 0 || (*cp < 'a' || *cp > 'h') && !isdigit(*cp))
fatal("%s: can't figure out file system partition",
argv[0]);
@ -589,7 +589,7 @@ rewritelabel(s, fd, lp)
cfd = open(specname, O_WRONLY);
if (cfd < 0)
fatal("%s: %s", specname, strerror(errno));
bzero(blk, sizeof(blk));
memset(blk, 0, sizeof(blk));
*(struct disklabel *)(blk + LABELOFFSET) = *lp;
alt = lp->d_ncylinders * lp->d_secpercyl - lp->d_nsectors;
for (i = 1; i < 11 && i < lp->d_nsectors; i += 2) {

View File

@ -32,7 +32,8 @@
*/
#ifndef lint
static char sccsid[] = "@(#)lfs.c 8.1 (Berkeley) 6/5/93";
/*static char sccsid[] = "from: @(#)lfs.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: lfs.c,v 1.2 1994/09/23 14:27:43 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -143,7 +144,8 @@ static struct lfs lfs_default = {
/* lfs_flags */ 0,
/* lfs_fsmnt */ { 0 },
/* lfs_pad */ { 0 },
/* lfs_cksum */ 0
/* lfs_cksum */ 0,
/* lfs_maxsymlinklen */ MAXSYMLINKLEN
};
@ -363,7 +365,7 @@ make_lfs(fd, lp, partp, minfree, block_size, seg_size)
if (!(dpagep = malloc(lfsp->lfs_bsize)))
fatal("%s", strerror(errno));
dip = (struct dinode *)dpagep;
bzero(dip, lfsp->lfs_bsize);
memset(dip, 0, lfsp->lfs_bsize);
/* Create a block of IFILE structures. */
if (!(ipagep = malloc(lfsp->lfs_bsize)))
@ -455,14 +457,14 @@ make_lfs(fd, lp, partp, minfree, block_size, seg_size)
*/
/* Write out the root and lost and found directories */
bzero(ipagep, lfsp->lfs_bsize);
memset(ipagep, 0, lfsp->lfs_bsize);
make_dir(ipagep, lfs_root_dir,
sizeof(lfs_root_dir) / sizeof(struct direct));
*dp++ = ((u_long *)ipagep)[0];
put(fd, off, ipagep, lfsp->lfs_bsize);
off += lfsp->lfs_bsize;
bzero(ipagep, lfsp->lfs_bsize);
memset(ipagep, 0, lfsp->lfs_bsize);
make_dir(ipagep, lfs_lf_dir,
sizeof(lfs_lf_dir) / sizeof(struct direct));
*dp++ = ((u_long *)ipagep)[0];
@ -511,7 +513,7 @@ make_lfs(fd, lp, partp, minfree, block_size, seg_size)
/* copy into segment */
sump = ipagep;
bcopy(&summary, sump, sizeof(SEGSUM));
memcpy(sump, &summary, sizeof(SEGSUM));
sump += sizeof(SEGSUM);
/* Now, add the ifile */
@ -519,9 +521,9 @@ make_lfs(fd, lp, partp, minfree, block_size, seg_size)
file_info.fi_version = 1;
file_info.fi_ino = LFS_IFILE_INUM;
bcopy(&file_info, sump, sizeof(FINFO) - sizeof(u_long));
memcpy(sump, &file_info, sizeof(FINFO) - sizeof(u_long));
sump += sizeof(FINFO) - sizeof(u_long);
bcopy(block_array, sump, sizeof(u_long) * file_info.fi_nblocks);
memcpy(sump, block_array, sizeof(u_long) * file_info.fi_nblocks);
sump += sizeof(u_long) * file_info.fi_nblocks;
/* Now, add the root directory */
@ -529,12 +531,12 @@ make_lfs(fd, lp, partp, minfree, block_size, seg_size)
file_info.fi_version = 1;
file_info.fi_ino = ROOTINO;
file_info.fi_blocks[0] = 0;
bcopy(&file_info, sump, sizeof(FINFO));
memcpy(sump, &file_info, sizeof(FINFO));
sump += sizeof(FINFO);
/* Now, add the lost and found */
file_info.fi_ino = LOSTFOUNDINO;
bcopy(&file_info, sump, sizeof(FINFO));
memcpy(sump, &file_info, sizeof(FINFO));
((daddr_t *)ipagep)[LFS_SUMMARY_SIZE / sizeof(daddr_t) - 1] =
lfsp->lfs_idaddr;
@ -605,10 +607,6 @@ put(fd, off, p, len)
* directory.
*/
u_long d_ino; /* inode number of entry */
u_short d_reclen; /* length of this record */
u_short d_namlen; /* length of string in d_name */
char d_name[MAXNAMLEN + 1]; /* name with length <= MAXNAMLEN */
void
lfsinit()
{}
@ -663,11 +661,11 @@ make_dir(bufp, protodir, entries)
spcleft = DIRBLKSIZ;
for (cp = bufp, i = 0; i < entries - 1; i++) {
protodir[i].d_reclen = DIRSIZ(NEWDIRFMT, &protodir[i]);
bcopy(&protodir[i], cp, protodir[i].d_reclen);
memcpy(cp, &protodir[i], protodir[i].d_reclen);
cp += protodir[i].d_reclen;
if ((spcleft -= protodir[i].d_reclen) < 0)
fatal("%s: %s", special, "directory too big");
}
protodir[i].d_reclen = spcleft;
bcopy(&protodir[i], cp, DIRSIZ(NEWDIRFMT, &protodir[i]));
memcpy(cp, &protodir[i], DIRSIZ(NEWDIRFMT, &protodir[i]));
}

View File

@ -38,7 +38,8 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
static char sccsid[] = "@(#)newfs.c 8.3 (Berkeley) 4/22/94";
/*static char sccsid[] = "from: @(#)newfs.c 8.3 (Berkeley) 4/22/94";*/
static char *rcsid = "$Id: newfs.c,v 1.2 1994/09/23 14:27:45 mycroft Exp $";
#endif /* not lint */
/*
@ -127,7 +128,7 @@ main(argc, argv)
int debug, lfs, fsi, fso, segsize;
char *cp, *opstring;
if (progname = rindex(*argv, '/'))
if (progname = strrchr(*argv, '/'))
++progname;
else
progname = *argv;
@ -269,7 +270,7 @@ main(argc, argv)
* prefix, try /dev/r%s and then /dev/%s.
*/
special = argv[0];
if (index(special, '/') == NULL) {
if (strchr(special, '/') == NULL) {
(void)sprintf(device, "%sr%s", _PATH_DEV, special);
if (stat(device, &st) == -1)
(void)sprintf(device, "%s%s", _PATH_DEV, special);
@ -293,7 +294,7 @@ main(argc, argv)
if (!debug && !mfs && !S_ISCHR(st.st_mode))
(void)printf("%s: %s: not a character-special device\n",
progname, special);
cp = index(argv[0], '\0') - 1;
cp = strchr(argv[0], '\0') - 1;
if (!debug && (cp == 0 || (*cp < 'a' || *cp > 'h') && !isdigit(*cp)))
fatal("%s: can't figure out file system partition", argv[0]);
@ -401,7 +402,7 @@ rewritelabel(s, fd, lp)
cfd = open(specname, O_WRONLY);
if (cfd < 0)
fatal("%s: %s", specname, strerror(errno));
bzero(blk, sizeof(blk));
memset(blk, 0, sizeof(blk));
*(struct disklabel *)(blk + LABELOFFSET) = *lp;
alt = lp->d_ncylinders * lp->d_secpercyl - lp->d_nsectors;
for (i = 1; i < 11 && i < lp->d_nsectors; i += 2) {

View File

@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)nfsd.c 8.7 (Berkeley) 2/22/94";*/
static char *rcsid = "$Id: nfsd.c,v 1.11 1994/06/08 19:31:49 mycroft Exp $";
static char *rcsid = "$Id: nfsd.c,v 1.12 1994/09/23 14:27:46 mycroft Exp $";
#endif not lint
#include <sys/param.h>
@ -408,7 +408,7 @@ main(argc, argv, envp)
*cp = (NFS_PORT & 0xff);
isoaddr.siso_len = sizeof(isoaddr);
if (bind(tp4sock,
(struct sockaddr *)&isoaddr, sizeof (isoaddr)) < 0) {
(struct sockaddr *)&isoaddr, sizeof(isoaddr)) < 0) {
syslog(LOG_ERR, "can't bind tp4 addr");
exit(1);
}

View File

@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)ping.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: ping.c,v 1.8 1994/09/23 01:39:00 mycroft Exp $";
static char *rcsid = "$Id: ping.c,v 1.9 1994/09/23 14:27:48 mycroft Exp $";
#endif /* not lint */
/*
@ -248,7 +248,7 @@ main(argc, argv)
usage();
target = *argv;
bzero((char *)&whereto, sizeof(struct sockaddr));
memset(&whereto, 0, sizeof(struct sockaddr));
to = (struct sockaddr_in *)&whereto;
to->sin_family = AF_INET;
to->sin_addr.s_addr = inet_addr(target);
@ -259,7 +259,7 @@ main(argc, argv)
if (!hp)
errx(1, "unknown host: %s", target);
to->sin_family = hp->h_addrtype;
bcopy(hp->h_addr, (caddr_t)&to->sin_addr, hp->h_length);
memcpy(&to->sin_addr, hp->h_addr, hp->h_length);
(void)strncpy(hnamebuf, hp->h_name, sizeof(hnamebuf) - 1);
hostname = hnamebuf;
}
@ -608,7 +608,7 @@ pr_pack(buf, cc, from)
break;
}
old_rrlen = i;
bcopy((char *)cp, old_rr, i);
memcpy(old_rr, cp, i);
(void)printf("\nRR: ");
for (;;) {
l = *++cp;

View File

@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)quotacheck.c 8.3 (Berkeley) 1/29/94";*/
static char *rcsid = "$Id: quotacheck.c,v 1.6 1994/08/16 19:22:02 mycroft Exp $";
static char *rcsid = "$Id: quotacheck.c,v 1.7 1994/09/23 14:27:50 mycroft Exp $";
#endif /* not lint */
/*
@ -448,7 +448,7 @@ hasquota(fs, type, qfnamep)
}
strcpy(buf, fs->fs_mntops);
for (opt = strtok(buf, ","); opt; opt = strtok(NULL, ",")) {
if (cp = index(opt, '='))
if (cp = strchr(opt, '='))
*cp++ = '\0';
if (type == USRQUOTA && strcmp(opt, usrname) == 0)
break;
@ -512,7 +512,7 @@ addid(id, type, name)
if (id > highid[type])
highid[type] = id;
if (name)
bcopy(name, fup->fu_name, len + 1);
memcpy(fup->fu_name, name, len + 1);
else
(void)sprintf(fup->fu_name, "%u", id);
return (fup);

View File

@ -38,7 +38,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)dirs.c 8.2 (Berkeley) 1/21/94";*/
static char *rcsid = "$Id: dirs.c,v 1.9 1994/06/18 18:20:46 mycroft Exp $";
static char *rcsid = "$Id: dirs.c,v 1.10 1994/09/23 14:27:53 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -412,7 +412,7 @@ putent(dp)
(void) fwrite(dirbuf, 1, DIRBLKSIZ, df);
dirloc = 0;
}
bcopy((char *)dp, dirbuf + dirloc, (long)dp->d_reclen);
memcpy(dirbuf + dirloc, dp, (long)dp->d_reclen);
prev = dirloc;
dirloc += dp->d_reclen;
}
@ -435,7 +435,7 @@ dcvt(odp, ndp)
register struct direct *ndp;
{
bzero((char *)ndp, (long)(sizeof *ndp));
memset(ndp, 0, (long)(sizeof *ndp));
ndp->d_ino = odp->d_ino;
ndp->d_type = DT_UNKNOWN;
(void) strncpy(ndp->d_name, odp->d_name, ODIRSIZ);
@ -641,7 +641,7 @@ genliteraldir(name, ino)
itp = inotablookup(ino);
if (itp == NULL)
panic("Cannot find directory inode %d named %s\n", ino, name);
if ((ofile = creat(name, 0666)) < 0) {
if ((ofile = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) {
fprintf(stderr, "%s: ", name);
(void) fflush(stderr);
fprintf(stderr, "cannot create file: %s\n", strerror(errno));

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)interactive.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: interactive.c,v 1.4 1994/06/08 19:33:35 mycroft Exp $";
static char *rcsid = "$Id: interactive.c,v 1.5 1994/09/23 14:27:54 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -707,7 +707,7 @@ glob_readdir(dirp)
return (NULL);
adirent.d_fileno = dp->d_ino;
adirent.d_namlen = dp->d_namlen;
bcopy(dp->d_name, adirent.d_name, dp->d_namlen + 1);
memcpy(adirent.d_name, dp->d_name, dp->d_namlen + 1);
return (&adirent);
}

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)symtab.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: symtab.c,v 1.4 1994/06/08 19:33:44 mycroft Exp $";
static char *rcsid = "$Id: symtab.c,v 1.5 1994/09/23 14:27:56 mycroft Exp $";
#endif /* not lint */
/*
@ -175,7 +175,7 @@ lookupparent(name)
struct entry *ep;
char *tailindex;
tailindex = rindex(name, '/');
tailindex = strrchr(name, '/');
if (tailindex == NULL)
return (NULL);
*tailindex = '\0';
@ -200,7 +200,7 @@ myname(ep)
for (cp = &namebuf[MAXPATHLEN - 2]; cp > &namebuf[ep->e_namlen]; ) {
cp -= ep->e_namlen;
bcopy(ep->e_name, cp, (long)ep->e_namlen);
memcpy(cp, ep->e_name, (long)ep->e_namlen);
if (ep == lookupino(ROOTINO))
return (cp);
*(--cp) = '/';
@ -230,7 +230,7 @@ addentry(name, inum, type)
if (freelist != NULL) {
np = freelist;
freelist = np->e_next;
bzero((char *)np, (long)sizeof(struct entry));
memset(np, 0, (long)sizeof(struct entry));
} else {
np = (struct entry *)calloc(1, sizeof(struct entry));
if (np == NULL)
@ -247,7 +247,7 @@ addentry(name, inum, type)
addino(ROOTINO, np);
return (np);
}
np->e_name = savename(rindex(name, '/') + 1);
np->e_name = savename(strrchr(name, '/') + 1);
np->e_namlen = strlen(np->e_name);
np->e_parent = ep;
np->e_sibling = ep->e_entries;
@ -331,7 +331,7 @@ moveentry(ep, newname)
ep->e_sibling = np->e_entries;
np->e_entries = ep;
}
cp = rindex(newname, '/') + 1;
cp = strrchr(newname, '/') + 1;
freename(ep->e_name);
ep->e_name = savename(cp);
ep->e_namlen = strlen(cp);
@ -485,8 +485,7 @@ dumpsymtable(filename, checkpt)
stroff = 0;
for (i = ROOTINO; i < maxino; i++) {
for (ep = lookupino(i); ep != NULL; ep = ep->e_links) {
bcopy((char *)ep, (char *)tep,
(long)sizeof(struct entry));
memcpy(tep, ep, (long)sizeof(struct entry));
tep->e_name = (char *)stroff;
stroff += allocsize(ep->e_namlen);
tep->e_parent = (struct entry *)ep->e_parent->e_index;

View File

@ -38,7 +38,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)tape.c 8.3 (Berkeley) 4/1/94";*/
static char *rcsid = "$Id: tape.c,v 1.12 1994/09/18 05:11:03 mycroft Exp $";
static char *rcsid = "$Id: tape.c,v 1.13 1994/09/23 14:27:57 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -120,9 +120,9 @@ setinput(source)
terminal = stdin;
#ifdef RRESTORE
if (index(source, ':')) {
if (strchr(source, ':')) {
host = source;
source = index(host, ':');
source = strchr(host, ':');
*source++ = '\0';
if (rmthost(host) == 0)
done(1);
@ -589,7 +589,8 @@ extractfile(name)
skipfile();
return (GOOD);
}
if ((ofile = creat(name, 0666)) < 0) {
if ((ofile = open(name, O_WRONLY | O_CREAT | O_TRUNC,
0666)) < 0) {
fprintf(stderr, "%s: cannot create file: %s\n",
name, strerror(errno));
skipfile();
@ -771,7 +772,7 @@ xtrmap(buf, size)
long size;
{
bcopy(buf, map, size);
memcpy(map, buf, size);
map += size;
}
@ -814,7 +815,7 @@ readtape(buf)
int cnt, seek_failed;
if (blkcnt < numtrec) {
bcopy(&tapebuf[(blkcnt++ * TP_BSIZE)], buf, (long)TP_BSIZE);
memcpy(buf, &tapebuf[(blkcnt++ * TP_BSIZE)], (long)TP_BSIZE);
blksread++;
tpblksread++;
return;
@ -886,7 +887,7 @@ getmore:
if (!yflag && !reply("continue"))
done(1);
i = ntrec * TP_BSIZE;
bzero(tapebuf, i);
memset(tapebuf, 0, i);
#ifdef RRESTORE
if (host)
seek_failed = (rmtseek(i, 1) < 0);
@ -917,10 +918,10 @@ getmore:
panic("partial block read: %d should be %d\n",
rd, ntrec * TP_BSIZE);
terminateinput();
bcopy((char *)&endoftapemark, &tapebuf[rd], (long)TP_BSIZE);
memcpy(&tapebuf[rd], &endoftapemark, (long)TP_BSIZE);
}
blkcnt = 0;
bcopy(&tapebuf[(blkcnt++ * TP_BSIZE)], buf, (long)TP_BSIZE);
memcpy(buf, &tapebuf[(blkcnt++ * TP_BSIZE)], (long)TP_BSIZE);
blksread++;
tpblksread++;
}
@ -1028,7 +1029,7 @@ gethead(buf)
goto good;
}
readtape((char *)(&u_ospcl.s_ospcl));
bzero((char *)buf, (long)TP_BSIZE);
memset(buf, 0, (long)TP_BSIZE);
buf->c_type = u_ospcl.s_ospcl.c_type;
buf->c_date = u_ospcl.s_ospcl.c_date;
buf->c_ddate = u_ospcl.s_ospcl.c_ddate;
@ -1047,7 +1048,7 @@ gethead(buf)
buf->c_dinode.di_mtime.ts_sec = u_ospcl.s_ospcl.c_dinode.odi_mtime;
buf->c_dinode.di_ctime.ts_sec = u_ospcl.s_ospcl.c_dinode.odi_ctime;
buf->c_count = u_ospcl.s_ospcl.c_count;
bcopy(u_ospcl.s_ospcl.c_addr, buf->c_addr, (long)256);
memcpy(buf->c_addr, u_ospcl.s_ospcl.c_addr, (long)256);
if (u_ospcl.s_ospcl.c_magic != OFS_MAGIC ||
checksum((int *)(&u_ospcl.s_ospcl)) == FAIL)
return(FAIL);

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)utilities.c 8.2 (Berkeley) 3/25/94";*/
static char *rcsid = "$Id: utilities.c,v 1.5 1994/06/08 19:33:47 mycroft Exp $";
static char *rcsid = "$Id: utilities.c,v 1.6 1994/09/23 14:27:59 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -62,7 +62,7 @@ pathcheck(name)
struct entry *ep;
char *start;
start = index(name, '/');
start = strchr(name, '/');
if (start == 0)
return;
for (cp = start; *cp != '\0'; cp++) {

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)ccitt_addr.c 8.1 (Berkeley) 6/5/93
* $Id: ccitt_addr.c,v 1.5 1994/05/13 08:02:17 mycroft Exp $
* $Id: ccitt_addr.c,v 1.6 1994/09/23 14:28:01 mycroft Exp $
*/
/*
* parse CCITT addresses
@ -63,7 +63,7 @@ register struct sockaddr_x25 *xp;
register char *p, *ap, *limit;
int havenet = 0;
bzero ((char *)xp, sizeof (*xp));
memset(xp, 0, sizeof (*xp));
xp->x25_family = AF_CCITT;
xp->x25_len = sizeof(*xp);
p = addr;

View File

@ -39,7 +39,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/19/94";*/
static char *rcsid = "$Id: route.c,v 1.7 1994/05/13 08:02:21 mycroft Exp $";
static char *rcsid = "$Id: route.c,v 1.8 1994/09/23 14:28:02 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -312,7 +312,7 @@ routename(sa)
if (first) {
first = 0;
if (gethostname(domain, MAXHOSTNAMELEN) == 0 &&
(cp = index(domain, '.')))
(cp = strchr(domain, '.')))
(void) strcpy(domain, cp + 1);
else
domain[0] = 0;
@ -333,7 +333,7 @@ routename(sa)
hp = gethostbyaddr((char *)&in, sizeof (struct in_addr),
AF_INET);
if (hp) {
if ((cp = index(hp->h_name, '.')) &&
if ((cp = strchr(hp->h_name, '.')) &&
!strcmp(cp + 1, domain))
*cp = 0;
cp = hp->h_name;
@ -663,7 +663,7 @@ newroute(argc, argv)
break;
if (af == AF_INET && *gateway && hp && hp->h_addr_list[1]) {
hp->h_addr_list++;
bcopy(hp->h_addr_list[0], &so_gate.sin.sin_addr,
memcpy(&so_gate.sin.sin_addr, hp->h_addr_list[0],
hp->h_length);
} else
break;
@ -808,7 +808,7 @@ getaddr(which, s, hpp)
if (which == RTA_DST) {
extern short ns_bh[3];
struct sockaddr_ns *sms = &(so_mask.sns);
bzero((char *)sms, sizeof(*sms));
memset(sms, 0, sizeof(*sms));
sms->sns_family = 0;
sms->sns_len = 6;
sms->sns_addr.x_net = *(union ns_net *)ns_bh;
@ -869,7 +869,7 @@ netdone:
if (hp) {
*hpp = hp;
su->sin.sin_family = hp->h_addrtype;
bcopy(hp->h_addr, (char *)&su->sin.sin_addr, hp->h_length);
memcpy(&su->sin.sin_addr, hp->h_addr, hp->h_length);
return (1);
}
(void) fprintf(stderr, "%s: bad value\n", s);
@ -999,12 +999,12 @@ rtmsg(cmd, flags)
#define NEXTADDR(w, u) \
if (rtm_addrs & (w)) {\
l = ROUNDUP(u.sa.sa_len); bcopy((char *)&(u), cp, l); cp += l;\
l = ROUNDUP(u.sa.sa_len); memcpy(cp, &(u), l); cp += l;\
if (verbose) sodump(&(u),"u");\
}
errno = 0;
bzero((char *)&m_rtmsg, sizeof(m_rtmsg));
memset(&m_rtmsg, 0, sizeof(m_rtmsg));
if (cmd == 'a')
cmd = RTM_ADD;
else if (cmd == 'c')
@ -1380,7 +1380,7 @@ sockaddr(addr, sa)
char *cplim = cp + size;
register int byte = 0, state = VIRGIN, new;
bzero(cp, size);
memset(cp, 0, size);
cp++;
do {
if ((*addr >= '0') && (*addr <= '9')) {

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)input.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: input.c,v 1.5 1994/05/13 08:04:39 mycroft Exp $";
static char *rcsid = "$Id: input.c,v 1.6 1994/09/23 14:28:05 mycroft Exp $";
#endif /* not lint */
/*
@ -126,7 +126,7 @@ rip_input(from, rip, size)
n->rip_metric = htonl(n->rip_metric);
}
rip->rip_cmd = RIPCMD_RESPONSE;
bcopy((char *)rip, packet, size);
memcpy(packet, rip, size);
(*afp->af_output)(s, 0, from, size);
return;

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)output.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: output.c,v 1.5 1994/05/13 08:04:45 mycroft Exp $";
static char *rcsid = "$Id: output.c,v 1.6 1994/09/23 14:28:06 mycroft Exp $";
#endif /* not lint */
/*
@ -105,7 +105,7 @@ supply(dst, flags, ifp, rtstate)
msg->rip_cmd = RIPCMD_RESPONSE;
msg->rip_vers = RIPVERSION;
bzero(msg->rip_res1, sizeof(msg->rip_res1));
memset(msg->rip_res1, 0, sizeof(msg->rip_res1));
again:
for (rh = base; rh < &base[ROUTEHASHSIZ]; rh++)
for (rt = rh->rt_forw; rt != (struct rt_entry *)rh; rt = rt->rt_forw) {

View File

@ -39,7 +39,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)query.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: query.c,v 1.5 1994/05/13 08:05:03 mycroft Exp $";
static char *rcsid = "$Id: query.c,v 1.6 1994/09/23 14:28:12 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -112,9 +112,9 @@ usage: printf("usage: query [-n] hosts...\n");
* may be more than one packet per host.
*/
bits = 1 << s;
bzero(&shorttime, sizeof(shorttime));
memset(&shorttime, 0, sizeof(shorttime));
shorttime.tv_usec = STIME;
bzero(&sigact, sizeof(sigact));
memset(&sigact, 0, sizeof(sigact));
sigact.sa_handler = timeout;
/*sigact.sa_flags = 0; /* no restart */
if (sigaction(SIGALRM, &sigact, (struct sigaction *)NULL) == -1)
@ -148,7 +148,7 @@ query(host)
struct hostent *hp;
struct servent *sp;
bzero((char *)&router, sizeof (router));
memset(&router, 0, sizeof (router));
router.sin_family = AF_INET;
router.sin_addr.s_addr = inet_addr(host);
if (router.sin_addr.s_addr == -1) {
@ -158,7 +158,7 @@ query(host)
herror((char *)NULL);
exit(1);
}
bcopy(hp->h_addr, &router.sin_addr, hp->h_length);
memcpy(&router.sin_addr, hp->h_addr, hp->h_length);
}
sp = getservbyname("router", "udp");
if (sp == 0) {

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)startup.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: startup.c,v 1.6 1994/05/13 08:04:50 mycroft Exp $";
static char *rcsid = "$Id: startup.c,v 1.7 1994/09/23 14:28:09 mycroft Exp $";
#endif /* not lint */
/*
@ -89,7 +89,7 @@ rt_xaddrs(cp, cplim, rtinfo)
register struct sockaddr *sa;
register int i;
bzero(rtinfo->rti_info, sizeof(rtinfo->rti_info));
memset(rtinfo->rti_info, 0, sizeof(rtinfo->rti_info));
for (i = 0; (i < RTAX_MAX) && (cp < cplim); i++) {
if ((rtinfo->rti_addrs & (1 << i)) == 0)
continue;
@ -133,7 +133,7 @@ ifinit()
for (cp = buf; cp < cplim; cp += ifm->ifm_msglen) {
ifm = (struct if_msghdr *)cp;
if (ifm->ifm_type == RTM_IFINFO) {
bzero(&ifs, sizeof(ifs));
memset(&ifs, 0, sizeof(ifs));
ifs.int_flags = flags = (0xffff & ifm->ifm_flags) | IFF_INTERFACE;
if ((flags & IFF_UP) == 0 || no_ipaddr)
lookforinterfaces = 1;
@ -277,7 +277,7 @@ addrouteforif(ifp)
if (ifp->int_flags & IFF_POINTOPOINT)
dst = &ifp->int_dstaddr;
else {
bzero((char *)&net, sizeof (net));
memset(&net, 0, sizeof (net));
net.sin_family = AF_INET;
net.sin_addr = inet_makeaddr(ifp->int_subnet, INADDR_ANY);
dst = (struct sockaddr *)&net;
@ -340,7 +340,7 @@ add_ptopt_localrt(ifp)
state = RTS_INTERFACE | RTS_PASSIVE;
/* look for route to logical network */
bzero((char *)&net, sizeof (net));
memset(&net, 0, sizeof (net));
net.sin_family = AF_INET;
net.sin_addr = inet_makeaddr(ifp->int_net, INADDR_ANY);
dst = (struct sockaddr *)&net;
@ -388,9 +388,9 @@ gwkludge()
dname = buf + 64;
gname = buf + ((BUFSIZ - 64) / 3);
type = buf + (((BUFSIZ - 64) * 2) / 3);
bzero((char *)&dst, sizeof (dst));
bzero((char *)&gate, sizeof (gate));
bzero((char *)&route, sizeof(route));
memset(&dst, 0, sizeof (dst));
memset(&gate, 0, sizeof (gate));
memset(&route, 0, sizeof(route));
/* format: {net | host} XX gateway XX metric DD [passive | external]\n */
#define readentry(fp) \
fscanf((fp), "%s %s gateway %s metric %d %s\n", \
@ -436,7 +436,7 @@ gwkludge()
/* assume no duplicate entries */
externalinterfaces++;
ifp = (struct interface *)malloc(sizeof (*ifp));
bzero((char *)ifp, sizeof (*ifp));
memset(ifp, 0, sizeof (*ifp));
ifp->int_flags = IFF_REMOTE;
/* can't identify broadcast capability */
ifp->int_net = inet_netof(dst.sin_addr);
@ -490,7 +490,7 @@ getnetorhostname(type, name, sin)
else {
if (hp->h_addrtype != AF_INET)
return (0);
bcopy(hp->h_addr, &sin->sin_addr, hp->h_length);
memcpy(&sin->sin_addr, hp->h_addr, hp->h_length);
}
sin->sin_family = AF_INET;
return (1);
@ -506,7 +506,7 @@ gethostnameornumber(name, sin)
hp = gethostbyname(name);
if (hp) {
bcopy(hp->h_addr, &sin->sin_addr, hp->h_length);
memcpy(&sin->sin_addr, hp->h_addr, hp->h_length);
sin->sin_family = hp->h_addrtype;
return (1);
}

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)tables.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: tables.c,v 1.7 1994/05/13 08:04:54 mycroft Exp $";
static char *rcsid = "$Id: tables.c,v 1.8 1994/09/23 14:28:10 mycroft Exp $";
#endif /* not lint */
/*
@ -386,7 +386,7 @@ rtioctl(action, ort)
} w;
#define rtm w.w_rtm
bzero((char *)&w, sizeof(w));
memset(&w, 0, sizeof(w));
rtm.rtm_msglen = sizeof(w);
rtm.rtm_version = RTM_VERSION;
rtm.rtm_type = (action == ADD ? RTM_ADD :
@ -395,8 +395,8 @@ rtioctl(action, ort)
rtm.rtm_flags = ort->rtu_flags;
rtm.rtm_seq = ++seqno;
rtm.rtm_addrs = RTA_DST|RTA_GATEWAY;
bcopy((char *)&ort->rtu_dst, (char *)&w.w_dst, sizeof(w.w_dst));
bcopy((char *)&ort->rtu_router, (char *)&w.w_gate, sizeof(w.w_gate));
memcpy(&w.w_dst, &ort->rtu_dst, sizeof(w.w_dst));
memcpy(&w.w_gate, &ort->rtu_router, sizeof(w.w_gate));
w.w_dst.sin_family = AF_INET;
w.w_dst.sin_len = sizeof(w.w_dst);
w.w_gate.sa_family = AF_INET;

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)trace.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: trace.c,v 1.5 1994/05/13 08:04:58 mycroft Exp $";
static char *rcsid = "$Id: trace.c,v 1.6 1994/09/23 14:28:11 mycroft Exp $";
#endif /* not lint */
/*
@ -211,7 +211,7 @@ trace(ifd, who, p, len, m)
len = 0;
}
if (len > 0)
bcopy(p, t->ift_packet, len);
memcpy(t->ift_packet, p, len);
t->ift_size = len;
t->ift_metric = m;
}

View File

@ -39,7 +39,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)trace.c 8.1 (Berkeley) 6/5/93";*/
static char *rcsid = "$Id: trace.c,v 1.5 1994/05/13 08:05:09 mycroft Exp $";
static char *rcsid = "$Id: trace.c,v 1.6 1994/09/23 14:28:14 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -98,7 +98,7 @@ usage:
}
if (argc == 0)
goto usage;
bzero((char *)&router, sizeof (router));
memset(&router, 0, sizeof (router));
router.sin_family = AF_INET;
sp = getservbyname("router", "udp");
if (sp == 0) {
@ -116,7 +116,7 @@ usage:
herror((char *)NULL);
continue;
}
bcopy(hp->h_addr, &router.sin_addr, hp->h_length);
memcpy(&router.sin_addr, hp->h_addr, hp->h_length);
}
if (sendto(s, packet, size, 0,
(struct sockaddr *)&router, sizeof(router)) < 0)

View File

@ -39,7 +39,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)savecore.c 8.3 (Berkeley) 1/2/94";*/
static char *rcsid = "$Id: savecore.c,v 1.16 1994/09/18 03:40:44 deraadt Exp $";
static char *rcsid = "$Id: savecore.c,v 1.17 1994/09/23 14:28:15 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -494,7 +494,7 @@ rawname(s)
{
char *sl, name[MAXPATHLEN];
if ((sl = rindex(s, '/')) == NULL || sl[1] == '0') {
if ((sl = strrchr(s, '/')) == NULL || sl[1] == '0') {
syslog(LOG_ERR,
"can't make raw dump device name from %s", s);
return (s);
@ -623,7 +623,7 @@ Create(file, mode)
{
register int fd;
fd = creat(file, mode);
fd = open(file, O_WRONLY | O_CREAT | O_TRUNC, mode);
if (fd < 0) {
syslog(LOG_ERR, "%s: %m", file);
exit(1);

View File

@ -39,7 +39,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)shutdown.c 8.2 (Berkeley) 2/16/94";*/
static char *rcsid = "$Id: shutdown.c,v 1.7 1994/09/17 00:10:12 mycroft Exp $";
static char *rcsid = "$Id: shutdown.c,v 1.8 1994/09/23 14:28:17 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -165,7 +165,7 @@ main(argc, argv)
break;
if (p != mbuf)
*p++ = ' ';
bcopy(*argv, p, arglen);
memcpy(p, *argv, arglen);
p += arglen;
}
*p = '\n';

View File

@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)mountd.c 8.8 (Berkeley) 2/20/94";*/
static char *rcsid = "$Id: mountd.c,v 1.14 1994/08/12 04:19:52 cgd Exp $";
static char *rcsid = "$Id: mountd.c,v 1.15 1994/09/23 14:27:37 mycroft Exp $";
#endif not lint
#include <sys/param.h>
@ -356,7 +356,7 @@ mntsrv(rqstp, transp)
(defset && scan_tree(ep->ex_defdir, saddr) == 0 &&
scan_tree(ep->ex_dirl, saddr) == 0))) {
/* Get the file handle */
bzero((caddr_t)&nfh, sizeof(nfh));
memset(&nfh, 0, sizeof(nfh));
if (getfh(dirpath, (fhandle_t *)&nfh) < 0) {
bad = errno;
syslog(LOG_ERR, "Can't get fh for %s", dirpath);
@ -879,7 +879,7 @@ get_exp()
ep = (struct exportlist *)malloc(sizeof (struct exportlist));
if (ep == (struct exportlist *)NULL)
out_of_mem();
bzero((caddr_t)ep, sizeof (struct exportlist));
memset(ep, 0, sizeof(struct exportlist));
return (ep);
}
@ -894,7 +894,7 @@ get_grp()
gp = (struct grouplist *)malloc(sizeof (struct grouplist));
if (gp == (struct grouplist *)NULL)
out_of_mem();
bzero((caddr_t)gp, sizeof (struct grouplist));
memset(gp, 0, sizeof(struct grouplist));
return (gp);
}
@ -1171,12 +1171,12 @@ do_opt(cpp, endcpp, ep, grp, has_hostp, exflagsp, cr)
while (cpopt && *cpopt) {
allflag = 1;
usedarg = -2;
if (cpoptend = index(cpopt, ',')) {
if (cpoptend = strchr(cpopt, ',')) {
*cpoptend++ = '\0';
if (cpoptarg = index(cpopt, '='))
if (cpoptarg = strchr(cpopt, '='))
*cpoptarg++ = '\0';
} else {
if (cpoptarg = index(cpopt, '='))
if (cpoptarg = strchr(cpopt, '='))
*cpoptarg++ = '\0';
else {
*cp = savedc;
@ -1302,13 +1302,12 @@ get_host(cp, grp)
malloc(sizeof(struct hostent));
if (nhp == (struct hostent *)NULL)
out_of_mem();
bcopy((caddr_t)hp, (caddr_t)nhp,
sizeof(struct hostent));
memcpy(nhp, hp, sizeof(struct hostent));
i = strlen(hp->h_name)+1;
nhp->h_name = (char *)malloc(i);
if (nhp->h_name == (char *)NULL)
out_of_mem();
bcopy(hp->h_name, nhp->h_name, i);
memcpy(nhp->h_name, hp->h_name, i);
addrp = hp->h_addr_list;
i = 1;
while (*addrp++)
@ -1323,8 +1322,7 @@ get_host(cp, grp)
malloc(hp->h_length);
if (*naddrp == (char *)NULL)
out_of_mem();
bcopy(*addrp, *naddrp,
hp->h_length);
memcpy(*naddrp, *addrp, hp->h_length);
addrp++;
naddrp++;
}
@ -1402,10 +1400,9 @@ get_isoaddr(cp, grp)
malloc(sizeof (struct sockaddr_iso));
if (isoaddr == (struct sockaddr_iso *)NULL)
out_of_mem();
bzero((caddr_t)isoaddr, sizeof (struct sockaddr_iso));
bcopy((caddr_t)isop, (caddr_t)&isoaddr->siso_addr,
sizeof (struct iso_addr));
isoaddr->siso_len = sizeof (struct sockaddr_iso);
memset(isoaddr, 0, sizeof(struct sockaddr_iso));
memcpy(&isoaddr->siso_addr, isop, sizeof(struct iso_addr));
isoaddr->siso_len = sizeof(struct sockaddr_iso);
isoaddr->siso_family = AF_ISO;
grp->gr_type = GT_ISO;
grp->gr_ptr.gt_isoaddr = isoaddr;
@ -1454,8 +1451,8 @@ do_mount(ep, grp, exflags, anoncrp, dirp, dirplen, fsb)
args.ua.fspec = 0;
args.ua.export.ex_flags = exflags;
args.ua.export.ex_anon = *anoncrp;
bzero((char *)&sin, sizeof(sin));
bzero((char *)&imask, sizeof(imask));
memset(&sin, 0, sizeof(sin));
memset(&imask, 0, sizeof(imask));
sin.sin_family = AF_INET;
sin.sin_len = sizeof(sin);
imask.sin_family = AF_INET;
@ -1769,7 +1766,7 @@ void
get_mountlist()
{
struct mountlist *mlp, **mlpp;
char *eos, *dirp;
char *host, *dirp, *cp;
int len;
char str[STRSIZ];
FILE *mlfile;
@ -1780,27 +1777,16 @@ get_mountlist()
}
mlpp = &mlhead;
while (fgets(str, STRSIZ, mlfile) != NULL) {
if ((dirp = index(str, '\t')) == NULL &&
(dirp = index(str, ' ')) == NULL)
cp = str;
host = strsep(&cp, " \t\n");
dirp = strsep(&cp, " \t\n");
if (host == NULL || dirp == NULL)
continue;
mlp = (struct mountlist *)malloc(sizeof (*mlp));
len = dirp-str;
if (len > RPCMNT_NAMELEN)
len = RPCMNT_NAMELEN;
bcopy(str, mlp->ml_host, len);
mlp->ml_host[len] = '\0';
while (*dirp == '\t' || *dirp == ' ')
dirp++;
if ((eos = index(dirp, '\t')) == NULL &&
(eos = index(dirp, ' ')) == NULL &&
(eos = index(dirp, '\n')) == NULL)
len = strlen(dirp);
else
len = eos-dirp;
if (len > RPCMNT_PATHLEN)
len = RPCMNT_PATHLEN;
bcopy(dirp, mlp->ml_dirp, len);
mlp->ml_dirp[len] = '\0';
strncpy(mlp->ml_host, host, RPCMNT_NAMELEN);
mlp->ml_host[RPCMNT_NAMELEN] = '\0';
strncpy(mlp->ml_dirp, dirp, RPCMNT_PATHLEN);
mlp->ml_dirp[RPCMNT_PATHLEN] = '\0';
mlp->ml_next = (struct mountlist *)NULL;
*mlpp = mlp;
mlpp = &mlp->ml_next;

View File

@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)nfsd.c 8.7 (Berkeley) 2/22/94";*/
static char *rcsid = "$Id: nfsd.c,v 1.11 1994/06/08 19:31:49 mycroft Exp $";
static char *rcsid = "$Id: nfsd.c,v 1.12 1994/09/23 14:27:46 mycroft Exp $";
#endif not lint
#include <sys/param.h>
@ -408,7 +408,7 @@ main(argc, argv, envp)
*cp = (NFS_PORT & 0xff);
isoaddr.siso_len = sizeof(isoaddr);
if (bind(tp4sock,
(struct sockaddr *)&isoaddr, sizeof (isoaddr)) < 0) {
(struct sockaddr *)&isoaddr, sizeof(isoaddr)) < 0) {
syslog(LOG_ERR, "can't bind tp4 addr");
exit(1);
}

View File

@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)quotacheck.c 8.3 (Berkeley) 1/29/94";*/
static char *rcsid = "$Id: quotacheck.c,v 1.6 1994/08/16 19:22:02 mycroft Exp $";
static char *rcsid = "$Id: quotacheck.c,v 1.7 1994/09/23 14:27:50 mycroft Exp $";
#endif /* not lint */
/*
@ -448,7 +448,7 @@ hasquota(fs, type, qfnamep)
}
strcpy(buf, fs->fs_mntops);
for (opt = strtok(buf, ","); opt; opt = strtok(NULL, ",")) {
if (cp = index(opt, '='))
if (cp = strchr(opt, '='))
*cp++ = '\0';
if (type == USRQUOTA && strcmp(opt, usrname) == 0)
break;
@ -512,7 +512,7 @@ addid(id, type, name)
if (id > highid[type])
highid[type] = id;
if (name)
bcopy(name, fup->fu_name, len + 1);
memcpy(fup->fu_name, name, len + 1);
else
(void)sprintf(fup->fu_name, "%u", id);
return (fup);