diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-07-13 23:54:04 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-07-13 23:54:04 +0000 |
commit | 3045f0573e3ce834b83de1532157108acab288bf (patch) | |
tree | d5d992e9e2ee2a2a8cad7c33e932d578e534ec39 | |
parent | 2d6105231faa533243032ed02e9aeaf5e0ce50a0 (diff) |
bcopy() -> memcpy() and fix some casts.
-rw-r--r-- | usr.bin/mail/aux.c | 12 | ||||
-rw-r--r-- | usr.bin/mail/cmd1.c | 14 | ||||
-rw-r--r-- | usr.bin/mail/cmd2.c | 13 | ||||
-rw-r--r-- | usr.bin/mail/cmd3.c | 32 | ||||
-rw-r--r-- | usr.bin/mail/collect.c | 34 | ||||
-rw-r--r-- | usr.bin/mail/dotlock.c | 28 | ||||
-rw-r--r-- | usr.bin/mail/edit.c | 32 | ||||
-rw-r--r-- | usr.bin/mail/fio.c | 26 | ||||
-rw-r--r-- | usr.bin/mail/lex.c | 14 | ||||
-rw-r--r-- | usr.bin/mail/main.c | 6 | ||||
-rw-r--r-- | usr.bin/mail/names.c | 22 | ||||
-rw-r--r-- | usr.bin/mail/popen.c | 32 | ||||
-rw-r--r-- | usr.bin/mail/quit.c | 22 | ||||
-rw-r--r-- | usr.bin/mail/send.c | 38 | ||||
-rw-r--r-- | usr.bin/mail/strings.c | 6 | ||||
-rw-r--r-- | usr.bin/mail/tty.c | 12 | ||||
-rw-r--r-- | usr.bin/mail/vars.c | 12 |
17 files changed, 177 insertions, 178 deletions
diff --git a/usr.bin/mail/aux.c b/usr.bin/mail/aux.c index 6d691e58f95..35ae408d251 100644 --- a/usr.bin/mail/aux.c +++ b/usr.bin/mail/aux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aux.c,v 1.5 1997/07/13 21:21:08 millert Exp $ */ +/* $OpenBSD: aux.c,v 1.6 1997/07/13 23:53:56 millert Exp $ */ /* $NetBSD: aux.c,v 1.5 1997/05/13 06:15:52 mikel Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)aux.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: aux.c,v 1.5 1997/07/13 21:21:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: aux.c,v 1.6 1997/07/13 23:53:56 millert Exp $"; #endif #endif /* not lint */ @@ -63,7 +63,7 @@ savestr(str) int size = strlen(str) + 1; if ((new = salloc(size)) != NOSTR) - bcopy(str, new, size); + (void)memcpy(new, str, size); return(new); } @@ -80,10 +80,10 @@ save2str(str, old) if ((new = salloc(newsize + oldsize)) != NOSTR) { if (oldsize) { - bcopy(old, new, oldsize); + (void)memcpy(new, old, oldsize); new[oldsize - 1] = ' '; } - bcopy(str, new + oldsize, newsize); + (void)memcpy(new + oldsize, str, newsize); } return(new); } @@ -244,7 +244,7 @@ gethfield(f, linebuf, rem, colon) if (cp + c >= linebuf + LINESIZE - 2) break; *cp++ = ' '; - bcopy(cp2, cp, c); + (void)memcpy(cp, cp2, c); cp += c; } *cp = 0; diff --git a/usr.bin/mail/cmd1.c b/usr.bin/mail/cmd1.c index a6a88df4f1c..6503dea30be 100644 --- a/usr.bin/mail/cmd1.c +++ b/usr.bin/mail/cmd1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd1.c,v 1.6 1997/07/13 21:21:08 millert Exp $ */ +/* $OpenBSD: cmd1.c,v 1.7 1997/07/13 23:53:57 millert Exp $ */ /* $NetBSD: cmd1.c,v 1.9 1997/07/09 05:29:48 mikel Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)cmd1.c 8.2 (Berkeley) 4/20/95"; #else -static char rcsid[] = "$OpenBSD: cmd1.c,v 1.6 1997/07/13 21:21:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: cmd1.c,v 1.7 1997/07/13 23:53:57 millert Exp $"; #endif #endif /* not lint */ @@ -185,7 +185,7 @@ printhead(mesg) char *name; mp = &message[mesg-1]; - (void) readline(setinput(mp), headline, LINESIZE); + (void)readline(setinput(mp), headline, LINESIZE); if ((subjline = hfield("subject", mp)) == NOSTR) subjline = hfield("subj", mp); /* @@ -317,8 +317,8 @@ type1(msgvec, doign, page) FILE *obuf; #if __GNUC__ /* Avoid longjmp clobbering */ - (void) &cp; - (void) &obuf; + (void)&cp; + (void)&obuf; #endif obuf = stdout; @@ -349,7 +349,7 @@ type1(msgvec, doign, page) dot = mp; if (value("quiet") == NOSTR) fprintf(obuf, "Message %d:\n", *ip); - (void) send(mp, obuf, doign ? ignore : 0, NOSTR); + (void)send(mp, obuf, doign ? ignore : 0, NOSTR); } close_pipe: if (obuf != stdout) { @@ -471,7 +471,7 @@ folders(v) } if ((cmd = value("LISTER")) == NOSTR) cmd = "ls"; - (void) run_command(cmd, 0, -1, -1, dirname, NOSTR, NOSTR); + (void)run_command(cmd, 0, -1, -1, dirname, NOSTR, NOSTR); return(0); } diff --git a/usr.bin/mail/cmd2.c b/usr.bin/mail/cmd2.c index 31b9a3f42db..6471cd2cfe1 100644 --- a/usr.bin/mail/cmd2.c +++ b/usr.bin/mail/cmd2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd2.c,v 1.3 1997/07/13 21:21:09 millert Exp $ */ +/* $OpenBSD: cmd2.c,v 1.4 1997/07/13 23:53:57 millert Exp $ */ /* $NetBSD: cmd2.c,v 1.7 1997/05/17 19:55:10 pk Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)cmd2.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: cmd2.c,v 1.3 1997/07/13 21:21:09 millert Exp $"; +static char rcsid[] = "$OpenBSD: cmd2.c,v 1.4 1997/07/13 23:53:57 millert Exp $"; #endif #endif /* not lint */ @@ -176,7 +176,7 @@ save1(str, mark, cmd, ignore) int f, *msgvec; FILE *obuf; - msgvec = (int *) salloc((msgCount + 2) * sizeof(*msgvec)); + msgvec = (int *)salloc((msgCount + 2) * sizeof(*msgvec)); if ((file = snarf(str, &f)) == NOSTR) return(1); if (!f) { @@ -500,9 +500,8 @@ ignore1(list, tab, which) if (member(field, tab)) continue; h = hash(field); - igp = (struct ignore *) calloc(1, sizeof(struct ignore)); - igp->i_field = calloc((unsigned) strlen(field) + 1, - sizeof(char)); + igp = (struct ignore *)calloc(1, sizeof(struct ignore)); + igp->i_field = (char *)calloc(strlen(field) + 1, sizeof(char)); strcpy(igp->i_field, field); igp->i_link = tab->i_head[h]; tab->i_head[h] = igp; @@ -527,7 +526,7 @@ igshow(tab, which) printf("No fields currently being %s.\n", which); return(0); } - ring = (char **) salloc((tab->i_count + 1) * sizeof(char *)); + ring = (char **)salloc((tab->i_count + 1) * sizeof(char *)); ap = ring; for (h = 0; h < HSHSIZE; h++) for (igp = tab->i_head[h]; igp != 0; igp = igp->i_link) diff --git a/usr.bin/mail/cmd3.c b/usr.bin/mail/cmd3.c index 3818dee9c5a..95f93241e73 100644 --- a/usr.bin/mail/cmd3.c +++ b/usr.bin/mail/cmd3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd3.c,v 1.5 1997/07/13 21:21:09 millert Exp $ */ +/* $OpenBSD: cmd3.c,v 1.6 1997/07/13 23:53:58 millert Exp $ */ /* $NetBSD: cmd3.c,v 1.8 1997/07/09 05:29:49 mikel Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)cmd3.c 8.2 (Berkeley) 4/20/95"; #else -static char rcsid[] = "$OpenBSD: cmd3.c,v 1.5 1997/07/13 21:21:09 millert Exp $"; +static char rcsid[] = "$OpenBSD: cmd3.c,v 1.6 1997/07/13 23:53:58 millert Exp $"; #endif #endif /* not lint */ @@ -65,13 +65,13 @@ shell(v) char *shell; char cmd[BUFSIZ]; - (void) strcpy(cmd, str); + (void)strcpy(cmd, str); if (bangexp(cmd) < 0) return(1); if ((shell = value("SHELL")) == NOSTR) shell = _PATH_CSHELL; - (void) run_command(shell, 0, -1, -1, "-c", cmd, NOSTR); - (void) signal(SIGINT, sigint); + (void)run_command(shell, 0, -1, -1, "-c", cmd, NOSTR); + (void)signal(SIGINT, sigint); puts("!"); return(0); } @@ -89,8 +89,8 @@ dosh(v) if ((shell = value("SHELL")) == NOSTR) shell = _PATH_CSHELL; - (void) run_command(shell, 0, -1, -1, NOSTR, NOSTR, NOSTR); - (void) signal(SIGINT, sigint); + (void)run_command(shell, 0, -1, -1, NOSTR, NOSTR, NOSTR); + (void)signal(SIGINT, sigint); putchar('\n'); return(0); } @@ -385,7 +385,7 @@ set(v) for (h = 0, s = 1; h < HSHSIZE; h++) for (vp = variables[h]; vp != NOVAR; vp = vp->v_link) s++; - ap = (char **) salloc(s * sizeof(*ap)); + ap = (char **)salloc(s * sizeof(*ap)); for (h = 0, p = ap; h < HSHSIZE; h++) for (vp = variables[h]; vp != NOVAR; vp = vp->v_link) *p++ = vp->v_name; @@ -442,7 +442,7 @@ unset(v) variables[h] = variables[h]->v_link; vfree(vp2->v_name); vfree(vp2->v_value); - free((char *)vp2); + (void)free(vp2); continue; } for (vp = variables[h]; vp->v_link != vp2; vp = vp->v_link) @@ -450,7 +450,7 @@ unset(v) vp->v_link = vp2->v_link; vfree(vp2->v_name); vfree(vp2->v_value); - free((char *) vp2); + (void)free(vp2); } return(errs); } @@ -473,7 +473,7 @@ group(v) for (h = 0, s = 1; h < HSHSIZE; h++) for (gh = groups[h]; gh != NOGRP; gh = gh->g_link) s++; - ap = (char **) salloc(s * sizeof(*ap)); + ap = (char **)salloc(s * sizeof(*ap)); for (h = 0, p = ap; h < HSHSIZE; h++) for (gh = groups[h]; gh != NOGRP; gh = gh->g_link) *p++ = gh->g_name; @@ -490,7 +490,7 @@ group(v) gname = *argv; h = hash(gname); if ((gh = findgroup(gname)) == NOGRP) { - gh = (struct grouphead *) calloc(sizeof(*gh), 1); + gh = (struct grouphead *)calloc(sizeof(*gh), 1); gh->g_name = vcopy(gname); gh->g_list = NOGE; gh->g_link = groups[h]; @@ -504,7 +504,7 @@ group(v) */ for (ap = argv+1; *ap != NOSTR; ap++) { - gp = (struct group *) calloc(sizeof(*gp), 1); + gp = (struct group *)calloc(sizeof(*gp), 1); gp->ge_name = vcopy(*ap); gp->ge_link = gh->g_list; gh->g_list = gp; @@ -742,10 +742,10 @@ alternates(v) return(0); } if (altnames != 0) - free((char *) altnames); - altnames = (char **) calloc((unsigned) c, sizeof(char *)); + (void)free(altnames); + altnames = (char **)calloc(c, sizeof(char *)); for (ap = namelist, ap2 = altnames; *ap; ap++, ap2++) { - cp = (char *) calloc((unsigned) strlen(*ap) + 1, sizeof(char)); + cp = (char *)calloc(strlen(*ap) + 1, sizeof(char)); strcpy(cp, *ap); *ap2 = cp; } diff --git a/usr.bin/mail/collect.c b/usr.bin/mail/collect.c index f6bfe3cf5c0..9b2401574a2 100644 --- a/usr.bin/mail/collect.c +++ b/usr.bin/mail/collect.c @@ -1,4 +1,4 @@ -/* $OpenBSD: collect.c,v 1.6 1997/07/13 21:21:10 millert Exp $ */ +/* $OpenBSD: collect.c,v 1.7 1997/07/13 23:53:58 millert Exp $ */ /* $NetBSD: collect.c,v 1.9 1997/07/09 05:25:45 mikel Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)collect.c 8.2 (Berkeley) 4/19/94"; #else -static char rcsid[] = "$OpenBSD: collect.c,v 1.6 1997/07/13 21:21:10 millert Exp $"; +static char rcsid[] = "$OpenBSD: collect.c,v 1.7 1997/07/13 23:53:58 millert Exp $"; #endif #endif /* not lint */ @@ -91,10 +91,10 @@ collect(hp, printheaders) #if __GNUC__ /* Avoid longjmp clobbering */ - (void) &escape; - (void) &eofcount; - (void) &getsub; - (void) &longline; + (void)&escape; + (void)&eofcount; + (void)&getsub; + (void)&longline; #endif collf = NULL; @@ -354,7 +354,7 @@ cont: break; } while ((t = getc(fbuf)) != EOF) - (void) putchar(t); + (void)putchar(t); (void)Fclose(fbuf); break; case 'p': @@ -366,7 +366,7 @@ cont: puts("-------\nMessage contains:"); puthead(hp, stdout, GTO|GSUBJECT|GCC|GBCC|GNL); while ((t = getc(collf)) != EOF) - (void) putchar(t); + (void)putchar(t); goto cont; case '|': /* @@ -443,7 +443,7 @@ exwrite(name, fp, f) cc++; if (c == '\n') lc++; - (void) putc(c, of); + (void)putc(c, of); if (ferror(of)) { warn(name); (void)Fclose(of); @@ -473,7 +473,7 @@ mesedit(fp, c) collf = nf; (void)Fclose(fp); } - (void) signal(SIGINT, sigint); + (void)signal(SIGINT, sigint); } /* @@ -496,7 +496,7 @@ mespipe(fp, cmd) warn(tempEdit); goto out; } - (void) unlink(tempEdit); + (void)unlink(tempEdit); /* * stdin = current message. * stdout = new message. @@ -516,11 +516,11 @@ mespipe(fp, cmd) /* * Take new files. */ - (void) fseek(nf, 0L, 2); + (void)fseek(nf, 0L, 2); collf = nf; (void)Fclose(fp); out: - (void) signal(SIGINT, sigint); + (void)signal(SIGINT, sigint); } /* @@ -542,8 +542,8 @@ forward(ms, fp, f) struct ignoretab *ig; char *tabst; - msgvec = (int *) salloc((msgCount+1) * sizeof(*msgvec)); - if (msgvec == (int *) NOSTR) + msgvec = (int *)salloc((msgCount+1) * sizeof(*msgvec)); + if (msgvec == (int *)NOSTR) return(0); if (getmsglist(ms, msgvec, 0) < 0) return(0); @@ -654,11 +654,11 @@ savedeadletter(fp) cp = getdeadletter(); c = umask(077); dbuf = Fopen(cp, "a"); - (void) umask(c); + (void)umask(c); if (dbuf == NULL) return; while ((c = getc(fp)) != EOF) - (void) putc(c, dbuf); + (void)putc(c, dbuf); (void)Fclose(dbuf); rewind(fp); } diff --git a/usr.bin/mail/dotlock.c b/usr.bin/mail/dotlock.c index 713b201bf54..ee6284c6c36 100644 --- a/usr.bin/mail/dotlock.c +++ b/usr.bin/mail/dotlock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dotlock.c,v 1.2 1997/07/13 21:21:11 millert Exp $ */ +/* $OpenBSD: dotlock.c,v 1.3 1997/07/13 23:53:59 millert Exp $ */ /* $NetBSD: dotlock.c,v 1.1 1996/06/08 19:48:19 christos Exp $ */ /* @@ -31,7 +31,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: dotlock.c,v 1.2 1997/07/13 21:21:11 millert Exp $"; +static char rcsid[] = "$OpenBSD: dotlock.c,v 1.3 1997/07/13 23:53:59 millert Exp $"; #endif #include <sys/types.h> @@ -76,8 +76,8 @@ create_exclusive(fname) int fd, serrno; struct stat st; - (void) gettimeofday(&tv, NULL); - (void) gethostname(hostname, MAXHOSTNAMELEN); + (void)gettimeofday(&tv, NULL); + (void)gethostname(hostname, MAXHOSTNAMELEN); pid = getpid(); cookie = pid ^ tv.tv_usec; @@ -90,7 +90,7 @@ create_exclusive(fname) else ptr++; - (void) snprintf(path, sizeof(path), "%.*s.%s.%x", + (void)snprintf(path, sizeof(path), "%.*s.%s.%x", ptr - fname, fname, hostname, cookie); /* @@ -121,7 +121,7 @@ create_exclusive(fname) if (stat(path, &st) == -1) goto bad; - (void) unlink(path); + (void)unlink(path); /* * If the number of links was two (one for the unique file and one @@ -135,7 +135,7 @@ create_exclusive(fname) bad: serrno = errno; - (void) unlink(path); + (void)unlink(path); errno = serrno; return(-1); } @@ -160,22 +160,22 @@ dot_lock(fname, pollinterval, fp, msg) sigaddset(&nset, SIGTSTP); sigaddset(&nset, SIGCHLD); - (void) snprintf(path, sizeof(path), "%s.lock", fname); + (void)snprintf(path, sizeof(path), "%s.lock", fname); for (;;) { - (void) sigprocmask(SIG_BLOCK, &nset, &oset); + (void)sigprocmask(SIG_BLOCK, &nset, &oset); if (create_exclusive(path) != -1) { - (void) sigprocmask(SIG_SETMASK, &oset, NULL); + (void)sigprocmask(SIG_SETMASK, &oset, NULL); return(0); } else - (void) sigprocmask(SIG_SETMASK, &oset, NULL); + (void)sigprocmask(SIG_SETMASK, &oset, NULL); if (errno != EEXIST) return(-1); if (fp && msg) - (void) fputs(msg, fp); + (void)fputs(msg, fp); if (pollinterval) { if (pollinterval == -1) { @@ -193,6 +193,6 @@ dot_unlock(fname) { char path[MAXPATHLEN]; - (void) snprintf(path, sizeof(path), "%s.lock", fname); - (void) unlink(path); + (void)snprintf(path, sizeof(path), "%s.lock", fname); + (void)unlink(path); } diff --git a/usr.bin/mail/edit.c b/usr.bin/mail/edit.c index 808f4528071..c52f2fa919d 100644 --- a/usr.bin/mail/edit.c +++ b/usr.bin/mail/edit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: edit.c,v 1.3 1997/07/13 21:21:11 millert Exp $ */ +/* $OpenBSD: edit.c,v 1.4 1997/07/13 23:53:59 millert Exp $ */ /* $NetBSD: edit.c,v 1.5 1996/06/08 19:48:20 christos Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)edit.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: edit.c,v 1.3 1997/07/13 21:21:11 millert Exp $"; +static char rcsid[] = "$OpenBSD: edit.c,v 1.4 1997/07/13 23:53:59 millert Exp $"; #endif #endif /* not lint */ @@ -117,7 +117,7 @@ edit1(msgvec, type) sigint = signal(SIGINT, SIG_IGN); fp = run_editor(setinput(mp), mp->m_size, type, readonly); if (fp != NULL) { - (void) fseek(otf, 0L, 2); + (void)fseek(otf, 0L, 2); size = ftell(otf); mp->m_block = blockof(size); mp->m_offset = offsetof(size); @@ -135,7 +135,7 @@ edit1(msgvec, type) warn("/tmp"); (void)Fclose(fp); } - (void) signal(SIGINT, sigint); + (void)signal(SIGINT, sigint); } return(0); } @@ -165,30 +165,30 @@ run_editor(fp, size, type, readonly) } if ((nf = Fdopen(t, "w")) == NULL) { warn(tempEdit); - (void) unlink(tempEdit); + (void)unlink(tempEdit); goto out; } if (size >= 0) while (--size >= 0 && (t = getc(fp)) != EOF) - (void) putc(t, nf); + (void)putc(t, nf); else while ((t = getc(fp)) != EOF) - (void) putc(t, nf); - (void) fflush(nf); + (void)putc(t, nf); + (void)fflush(nf); if (fstat(fileno(nf), &statb) < 0) modtime = 0; else modtime = statb.st_mtime; if (ferror(nf)) { - (void) Fclose(nf); + (void)Fclose(nf); warn(tempEdit); - (void) unlink(tempEdit); + (void)unlink(tempEdit); nf = NULL; goto out; } if (Fclose(nf) < 0) { warn(tempEdit); - (void) unlink(tempEdit); + (void)unlink(tempEdit); nf = NULL; goto out; } @@ -196,7 +196,7 @@ run_editor(fp, size, type, readonly) if ((edit = value(type == 'e' ? "EDITOR" : "VISUAL")) == NOSTR) edit = type == 'e' ? _PATH_EX : _PATH_VI; if (run_command(edit, 0, -1, -1, tempEdit, NOSTR, NOSTR) < 0) { - (void) unlink(tempEdit); + (void)unlink(tempEdit); goto out; } /* @@ -204,7 +204,7 @@ run_editor(fp, size, type, readonly) * temporary and return. */ if (readonly) { - (void) unlink(tempEdit); + (void)unlink(tempEdit); goto out; } if (stat(tempEdit, &statb) < 0) { @@ -212,7 +212,7 @@ run_editor(fp, size, type, readonly) goto out; } if (modtime == statb.st_mtime) { - (void) unlink(tempEdit); + (void)unlink(tempEdit); goto out; } /* @@ -220,10 +220,10 @@ run_editor(fp, size, type, readonly) */ if ((nf = Fopen(tempEdit, "a+")) == NULL) { warn(tempEdit); - (void) unlink(tempEdit); + (void)unlink(tempEdit); goto out; } - (void) unlink(tempEdit); + (void)unlink(tempEdit); out: return(nf); } diff --git a/usr.bin/mail/fio.c b/usr.bin/mail/fio.c index 9fd45a9c4cf..b784a6475ed 100644 --- a/usr.bin/mail/fio.c +++ b/usr.bin/mail/fio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fio.c,v 1.6 1997/07/13 21:21:12 millert Exp $ */ +/* $OpenBSD: fio.c,v 1.7 1997/07/13 23:53:59 millert Exp $ */ /* $NetBSD: fio.c,v 1.8 1997/07/07 22:57:55 phil Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)fio.c 8.2 (Berkeley) 4/20/95"; #else -static char rcsid[] = "$OpenBSD: fio.c,v 1.6 1997/07/13 21:21:12 millert Exp $"; +static char rcsid[] = "$OpenBSD: fio.c,v 1.7 1997/07/13 23:53:59 millert Exp $"; #endif #endif /* not lint */ @@ -84,14 +84,14 @@ setptr(ibuf, offset) msgCount = 0; } else { /* Seek into the file to get to the new messages */ - (void) fseek(ibuf, offset, 0); + (void)fseek(ibuf, offset, 0); /* * We need to make "offset" a pointer to the end of * the temp file that has the copy of the mail file. * If any messages have been edited, this will be * different from the offset into the mail file. */ - (void) fseek(otf, 0L, SEEK_END); + (void)fseek(otf, 0L, SEEK_END); offset = ftell(otf); } omsgCount = msgCount; @@ -110,7 +110,7 @@ setptr(ibuf, offset) return; } count = strlen(linebuf); - (void) fwrite(linebuf, sizeof(*linebuf), count, otf); + (void)fwrite(linebuf, sizeof(*linebuf), count, otf); if (ferror(otf)) err(1, "/tmp"); linebuf[count - 1] = '\0'; @@ -166,9 +166,9 @@ putline(obuf, linebuf, outlf) register int c; c = strlen(linebuf); - (void) fwrite(linebuf, sizeof(*linebuf), c, obuf); + (void)fwrite(linebuf, sizeof(*linebuf), c, obuf); if (outlf) { - (void) putc('\n', obuf); + (void)putc('\n', obuf); c++; } if (ferror(obuf)) @@ -225,22 +225,22 @@ makemessage(f, omsgCount) FILE *f; int omsgCount; { - register size = (msgCount + 1) * sizeof(struct message); + register size_t size = (msgCount + 1) * sizeof(struct message); if (omsgCount) { - message = (struct message *)realloc(message, (unsigned) size); + message = (struct message *)realloc(message, size); if (message == 0) panic("Insufficient memory for %d messages\n", msgCount); } else { if (message != 0) - free((char *) message); - if ((message = (struct message *) malloc((unsigned) size)) == 0) + (void)free(message); + if ((message = (struct message *)malloc(size)) == 0) panic("Insufficient memory for %d messages", msgCount); dot = message; } size -= (omsgCount + 1) * sizeof(struct message); fflush(f); - (void) lseek(fileno(f), (off_t)sizeof(*message), 0); + (void)lseek(fileno(f), (off_t)sizeof(*message), 0); if (read(fileno(f), (void *) &message[omsgCount], size) != size) panic("Message temporary file corrupted"); message[msgCount].m_size = 0; @@ -455,7 +455,7 @@ getdeadletter() else if (*cp != '/') { char buf[PATHSIZE]; - (void) snprintf(buf, sizeof(buf), "~/%s", cp); + (void)snprintf(buf, sizeof(buf), "~/%s", cp); cp = expand(buf); } return(cp); diff --git a/usr.bin/mail/lex.c b/usr.bin/mail/lex.c index bcd3fb91613..aa73af0eeb2 100644 --- a/usr.bin/mail/lex.c +++ b/usr.bin/mail/lex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lex.c,v 1.6 1997/07/13 21:21:13 millert Exp $ */ +/* $OpenBSD: lex.c,v 1.7 1997/07/13 23:54:00 millert Exp $ */ /* $NetBSD: lex.c,v 1.10 1997/05/17 19:55:13 pk Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)lex.c 8.2 (Berkeley) 4/20/95"; #else -static char rcsid[] = "$OpenBSD: lex.c,v 1.6 1997/07/13 21:21:13 millert Exp $"; +static char rcsid[] = "$OpenBSD: lex.c,v 1.7 1997/07/13 23:54:00 millert Exp $"; #endif #endif /* not lint */ @@ -140,10 +140,10 @@ setfile(name) mailsize = fsize(ibuf); if ((otf = fopen(tempMesg, "w")) == NULL) err(1, tempMesg); - (void) fcntl(fileno(otf), F_SETFD, 1); + (void)fcntl(fileno(otf), F_SETFD, 1); if ((itf = fopen(tempMesg, "r")) == NULL) err(1, tempMesg); - (void) fcntl(fileno(itf), F_SETFD, 1); + (void)fcntl(fileno(itf), F_SETFD, 1); rm(tempMesg); setptr(ibuf, 0); setmsize(msgCount); @@ -210,7 +210,7 @@ commands() char linebuf[LINESIZE]; #if __GNUC__ /* Avoid longjmp clobbering */ - (void) &eofloop; + (void)&eofloop; #endif if (!sourcing) { @@ -489,8 +489,8 @@ setmsize(sz) { if (msgvec != 0) - free((char *) msgvec); - msgvec = (int *) calloc((unsigned) (sz + 1), sizeof(*msgvec)); + (void)free(msgvec); + msgvec = (int *)calloc(sz + 1, sizeof(*msgvec)); } /* diff --git a/usr.bin/mail/main.c b/usr.bin/mail/main.c index bb867161101..f94308f2ec8 100644 --- a/usr.bin/mail/main.c +++ b/usr.bin/mail/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.5 1997/07/13 21:21:15 millert Exp $ */ +/* $OpenBSD: main.c,v 1.6 1997/07/13 23:54:00 millert Exp $ */ /* $NetBSD: main.c,v 1.7 1997/05/13 06:15:57 mikel Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 4/20/95"; #else -static char rcsid[] = "$OpenBSD: main.c,v 1.5 1997/07/13 21:21:15 millert Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.6 1997/07/13 23:54:00 millert Exp $"; #endif #endif /* not lint */ @@ -79,7 +79,7 @@ main(argc, argv) * Figure out whether we are being run interactively, * start the SIGCHLD catcher, and so forth. */ - (void) signal(SIGCHLD, sigchild); + (void)signal(SIGCHLD, sigchild); if (isatty(0)) assign("interactive", ""); image = -1; diff --git a/usr.bin/mail/names.c b/usr.bin/mail/names.c index 94c0e8f4bcb..8a833bcbe95 100644 --- a/usr.bin/mail/names.c +++ b/usr.bin/mail/names.c @@ -1,4 +1,4 @@ -/* $OpenBSD: names.c,v 1.4 1997/07/13 21:21:15 millert Exp $ */ +/* $OpenBSD: names.c,v 1.5 1997/07/13 23:54:01 millert Exp $ */ /* $NetBSD: names.c,v 1.5 1996/06/08 19:48:32 christos Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)names.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: names.c,v 1.4 1997/07/13 21:21:15 millert Exp $"; +static char rcsid[] = "$OpenBSD: names.c,v 1.5 1997/07/13 23:54:01 millert Exp $"; #endif #endif /* not lint */ @@ -64,7 +64,7 @@ nalloc(str, ntype) { register struct name *np; - np = (struct name *) salloc(sizeof(*np)); + np = (struct name *)salloc(sizeof(*np)); np->n_flink = NIL; np->n_blink = NIL; np->n_type = ntype; @@ -234,7 +234,7 @@ outof(names, fo, hp) top = names; np = names; - (void) time(&now); + (void)time(&now); date = ctime(&now); while (np != NIL) { if (!isfileaddr(np->n_name) && np->n_name[0] != '|') { @@ -259,21 +259,21 @@ outof(names, fo, hp) goto cant; } image = open(tempEdit, 2); - (void) unlink(tempEdit); + (void)unlink(tempEdit); if (image < 0) { warn(tempEdit); senderr++; (void)Fclose(fout); goto cant; } - (void) fcntl(image, F_SETFD, 1); + (void)fcntl(image, F_SETFD, 1); fprintf(fout, "From %s %s", myname, date); puthead(hp, fout, GTO|GSUBJECT|GCC|GNL); while ((c = getc(fo)) != EOF) - (void) putc(c, fout); + (void)putc(c, fout); rewind(fo); - (void) putc('\n', fout); - (void) fflush(fout); + (void)putc('\n', fout); + (void)fflush(fout); if (ferror(fout)) warn(tempEdit); (void)Fclose(fout); @@ -330,7 +330,7 @@ outof(names, fo, hp) } rewind(fin); while ((c = getc(fin)) != EOF) - (void) putc(c, fout); + (void)putc(c, fout); if (ferror(fout)) { senderr++; warn(fname); @@ -510,7 +510,7 @@ unpack(np) verbose = value("verbose") != NOSTR; if (verbose) extra++; - top = (char **) salloc((t + extra) * sizeof(*top)); + top = (char **)salloc((t + extra) * sizeof(*top)); ap = top; *ap++ = "send-mail"; *ap++ = "-i"; diff --git a/usr.bin/mail/popen.c b/usr.bin/mail/popen.c index 30194940932..88eddc6f15d 100644 --- a/usr.bin/mail/popen.c +++ b/usr.bin/mail/popen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: popen.c,v 1.6 1997/07/13 21:21:15 millert Exp $ */ +/* $OpenBSD: popen.c,v 1.7 1997/07/13 23:54:01 millert Exp $ */ /* $NetBSD: popen.c,v 1.6 1997/05/13 06:48:42 mikel Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)popen.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: popen.c,v 1.6 1997/07/13 21:21:15 millert Exp $"; +static char rcsid[] = "$OpenBSD: popen.c,v 1.7 1997/07/13 23:54:01 millert Exp $"; #endif #endif /* not lint */ @@ -79,7 +79,7 @@ Fopen(file, mode) if ((fp = fopen(file, mode)) != NULL) { register_file(fp, 0, 0); - (void) fcntl(fileno(fp), F_SETFD, 1); + (void)fcntl(fileno(fp), F_SETFD, 1); } return(fp); } @@ -93,7 +93,7 @@ Fdopen(fd, mode) if ((fp = fdopen(fd, mode)) != NULL) { register_file(fp, 0, 0); - (void) fcntl(fileno(fp), F_SETFD, 1); + (void)fcntl(fileno(fp), F_SETFD, 1); } return(fp); } @@ -119,8 +119,8 @@ Popen(cmd, mode) if (pipe(p) < 0) return(NULL); - (void) fcntl(p[READ], F_SETFD, 1); - (void) fcntl(p[WRITE], F_SETFD, 1); + (void)fcntl(p[READ], F_SETFD, 1); + (void)fcntl(p[WRITE], F_SETFD, 1); if (*mode == 'r') { myside = p[READ]; fd0 = -1; @@ -179,7 +179,7 @@ register_file(fp, pipe, pid) { struct fp *fpp; - if ((fpp = (struct fp *) malloc(sizeof(*fpp))) == NULL) + if ((fpp = (struct fp *)malloc(sizeof(*fpp))) == NULL) panic("Out of memory"); fpp->fp = fp; fpp->pipe = pipe; @@ -197,7 +197,7 @@ unregister_file(fp) for (pp = &fp_head; (p = *pp) != NULL; pp = &p->link) if (p->fp == fp) { *pp = p->link; - free((char *) p); + (void)free(p); return; } panic("Invalid file pointer"); @@ -289,12 +289,12 @@ prepare_child(nset, infd, outfd) if (nset != NULL) { for (i = 1; i < NSIG; i++) if (sigismember(nset, i)) - (void) signal(i, SIG_IGN); + (void)signal(i, SIG_IGN); } if (nset == NULL || !sigismember(nset, SIGINT)) - (void) signal(SIGINT, SIG_DFL); + (void)signal(SIGINT, SIG_DFL); sigfillset(&fset); - (void) sigprocmask(SIG_UNBLOCK, &fset, NULL); + (void)sigprocmask(SIG_UNBLOCK, &fset, NULL); } int @@ -319,7 +319,7 @@ findchild(pid) cpp = &(*cpp)->link) ; if (*cpp == NULL) { - *cpp = (struct child *) malloc(sizeof(struct child)); + *cpp = (struct child *)malloc(sizeof(struct child)); (*cpp)->pid = pid; (*cpp)->done = (*cpp)->free = 0; (*cpp)->link = NULL; @@ -336,7 +336,7 @@ delchild(cp) for (cpp = &child; *cpp != cp; cpp = &(*cpp)->link) ; *cpp = cp->link; - free((char *) cp); + (void)free(cp); } void @@ -426,17 +426,17 @@ handle_spool_locks(action) lockfp = NULL; } else if (action == 1) { /* Create the lock */ - if ((cmd = (char *) malloc(sizeof(_PATH_MAIL_LOCAL) + 3)) == NULL) + if ((cmd = (char *)malloc(sizeof(_PATH_MAIL_LOCAL) + 3)) == NULL) panic("Out of memory"); sprintf(cmd, "%s -H", _PATH_MAIL_LOCAL); if ((lockfp = Popen(cmd, "r")) == NULL || getc(lockfp) != '1') { lockfp = NULL; - free(cmd); + (void)free(cmd); return(0); } lock_pid = fp_head->pid; /* new entries added at head */ - free(cmd); + (void)free(cmd); } else { fprintf(stderr, "handle_spool_locks: unknown action %d\n", action); diff --git a/usr.bin/mail/quit.c b/usr.bin/mail/quit.c index f4d3e51ba5f..bd0c011b5e6 100644 --- a/usr.bin/mail/quit.c +++ b/usr.bin/mail/quit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: quit.c,v 1.4 1997/07/13 21:21:16 millert Exp $ */ +/* $OpenBSD: quit.c,v 1.5 1997/07/13 23:54:02 millert Exp $ */ /* $NetBSD: quit.c,v 1.6 1996/12/28 07:11:07 tls Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)quit.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: quit.c,v 1.4 1997/07/13 21:21:16 millert Exp $"; +static char rcsid[] = "$OpenBSD: quit.c,v 1.5 1997/07/13 23:54:02 millert Exp $"; #endif #endif /* not lint */ @@ -130,14 +130,14 @@ quit() #ifdef APPEND fseek(fbuf, (long)mailsize, 0); while ((c = getc(fbuf)) != EOF) - (void) putc(c, rbuf); + (void)putc(c, rbuf); #else p = minfo.st_size - mailsize; while (p-- > 0) { c = getc(fbuf); if (c == EOF) goto newmail; - (void) putc(c, rbuf); + (void)putc(c, rbuf); } #endif (void)Fclose(rbuf); @@ -233,7 +233,7 @@ quit() rm(tempQuit); if ((abuf = Fopen(mbox, "r")) != NULL) { while ((c = getc(abuf)) != EOF) - (void) putc(c, obuf); + (void)putc(c, obuf); (void)Fclose(abuf); } if (ferror(obuf)) { @@ -284,7 +284,7 @@ quit() rewind(ibuf); c = getc(ibuf); while (c != EOF) { - (void) putc(c, obuf); + (void)putc(c, obuf); if (ferror(obuf)) break; c = getc(ibuf); @@ -329,7 +329,7 @@ cream: if (abuf == NULL) goto newmail; while ((c = getc(rbuf)) != EOF) - (void) putc(c, abuf); + (void)putc(c, abuf); (void)Fclose(rbuf); trunc(abuf); (void)Fclose(abuf); @@ -373,7 +373,7 @@ writeback(res) #ifndef APPEND if (res != NULL) while ((c = getc(res)) != EOF) - (void) putc(c, obuf); + (void)putc(c, obuf); #endif for (mp = &message[0]; mp < &message[msgCount]; mp++) if ((mp->m_flag&MPRESERVE)||(mp->m_flag&MTOUCH)==0) { @@ -387,7 +387,7 @@ writeback(res) #ifdef APPEND if (res != NULL) while ((c = getc(res)) != EOF) - (void) putc(c, obuf); + (void)putc(c, obuf); #endif fflush(obuf); trunc(obuf); @@ -467,7 +467,7 @@ edstop() } fseek(ibuf, (long)mailsize, 0); while ((c = getc(ibuf)) != EOF) - (void) putc(c, obuf); + (void)putc(c, obuf); (void)Fclose(ibuf); (void)Fclose(obuf); if ((ibuf = Fopen(tempname, "r")) == NULL) { @@ -500,7 +500,7 @@ edstop() gotcha = (c == 0 && ibuf == NULL); if (ibuf != NULL) { while ((c = getc(ibuf)) != EOF) - (void) putc(c, obuf); + (void)putc(c, obuf); (void)Fclose(ibuf); } fflush(obuf); diff --git a/usr.bin/mail/send.c b/usr.bin/mail/send.c index 72ad046f065..3b80ea46ed7 100644 --- a/usr.bin/mail/send.c +++ b/usr.bin/mail/send.c @@ -1,4 +1,4 @@ -/* $OpenBSD: send.c,v 1.3 1997/07/13 21:21:16 millert Exp $ */ +/* $OpenBSD: send.c,v 1.4 1997/07/13 23:54:02 millert Exp $ */ /* $NetBSD: send.c,v 1.6 1996/06/08 19:48:39 christos Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)send.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: send.c,v 1.3 1997/07/13 21:21:16 millert Exp $"; +static char rcsid[] = "$OpenBSD: send.c,v 1.4 1997/07/13 23:54:02 millert Exp $"; #endif #endif /* not lint */ @@ -145,7 +145,7 @@ send(mp, obuf, doign, prefix) } if (doign != ignoreall) /* add blank line */ - (void) putc('\n', obuf); + (void)putc('\n', obuf); ishead = 0; ignoring = 0; } else { @@ -183,9 +183,9 @@ send(mp, obuf, doign, prefix) if (length > 1) fputs(prefix, obuf); else - (void) fwrite(prefix, sizeof(*prefix), + (void)fwrite(prefix, sizeof(*prefix), prefixlen, obuf); - (void) fwrite(line, sizeof(*line), length, obuf); + (void)fwrite(line, sizeof(*line), length, obuf); if (ferror(obuf)) return(-1); } @@ -209,9 +209,9 @@ send(mp, obuf, doign, prefix) if (c > 1) fputs(prefix, obuf); else - (void) fwrite(prefix, sizeof(*prefix), + (void)fwrite(prefix, sizeof(*prefix), prefixlen, obuf); - (void) fwrite(line, sizeof(*line), c, obuf); + (void)fwrite(line, sizeof(*line), c, obuf); if (ferror(obuf)) return(-1); } @@ -323,7 +323,7 @@ mail1(hp, printheaders) grabh(hp, GBCC); } else { puts("EOT"); - (void) fflush(stdout); + (void)fflush(stdout); } if (fsize(mtf) == 0) if (hp->h_subject == NOSTR) @@ -367,7 +367,7 @@ mail1(hp, printheaders) goto out; } if ((cp = value("record")) != NOSTR) - (void) savemail(expand(cp), mtf); + (void)savemail(expand(cp), mtf); /* * Fork, set up the temporary mail file as standard * input for "mail", and exec with the user list we generated @@ -398,7 +398,7 @@ mail1(hp, printheaders) _exit(1); } if (value("verbose") != NOSTR) - (void) wait_child(pid); + (void)wait_child(pid); else free_child(pid); out: @@ -453,11 +453,11 @@ infix(hp, fi) (void)Fclose(nfo); return(fi); } - (void) rm(tempMail); - (void) puthead(hp, nfo, GTO|GSUBJECT|GCC|GBCC|GNL|GCOMMA); + (void)rm(tempMail); + (void)puthead(hp, nfo, GTO|GSUBJECT|GCC|GBCC|GNL|GCOMMA); c = getc(fi); while (c != EOF) { - (void) putc(c, nfo); + (void)putc(c, nfo); c = getc(fi); } if (ferror(fi)) { @@ -465,7 +465,7 @@ infix(hp, fi) rewind(fi); return(fi); } - (void) fflush(nfo); + (void)fflush(nfo); if (ferror(nfo)) { warn(tempMail); (void)Fclose(nfo); @@ -501,7 +501,7 @@ puthead(hp, fo, w) if (hp->h_bcc != NIL && w & GBCC) fmt("Bcc:", hp->h_bcc, fo, w&GCOMMA), gotcha++; if (gotcha && w & GNL) - (void) putc('\n', fo); + (void)putc('\n', fo); return(0); } @@ -558,12 +558,12 @@ savemail(name, fi) warn(name); return(-1); } - (void) time(&now); + (void)time(&now); fprintf(fo, "From %s %s", myname, ctime(&now)); while ((i = fread(buf, 1, sizeof(buf), fi)) > 0) - (void) fwrite(buf, 1, i, fo); - (void) putc('\n', fo); - (void) fflush(fo); + (void)fwrite(buf, 1, i, fo); + (void)putc('\n', fo); + (void)fflush(fo); if (ferror(fo)) warn(name); (void)Fclose(fo); diff --git a/usr.bin/mail/strings.c b/usr.bin/mail/strings.c index f7d10710094..182d50cb3aa 100644 --- a/usr.bin/mail/strings.c +++ b/usr.bin/mail/strings.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strings.c,v 1.3 1997/07/13 21:21:17 millert Exp $ */ +/* $OpenBSD: strings.c,v 1.4 1997/07/13 23:54:02 millert Exp $ */ /* $NetBSD: strings.c,v 1.5 1996/06/08 19:48:40 christos Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)strings.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: strings.c,v 1.3 1997/07/13 21:21:17 millert Exp $"; +static char rcsid[] = "$OpenBSD: strings.c,v 1.4 1997/07/13 23:54:02 millert Exp $"; #endif #endif /* not lint */ @@ -85,7 +85,7 @@ salloc(size) panic("String too large"); if (sp->s_topFree == NOSTR) { index = sp - &stringdope[0]; - sp->s_topFree = malloc(STRINGSIZE << index); + sp->s_topFree = (char *)malloc(STRINGSIZE << index); if (sp->s_topFree == NOSTR) { fprintf(stderr, "No room for space %d\n", index); panic("Internal error"); diff --git a/usr.bin/mail/tty.c b/usr.bin/mail/tty.c index 9b58d2004eb..f2579761ba0 100644 --- a/usr.bin/mail/tty.c +++ b/usr.bin/mail/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.3 1997/07/13 21:21:17 millert Exp $ */ +/* $OpenBSD: tty.c,v 1.4 1997/07/13 23:54:03 millert Exp $ */ /* $NetBSD: tty.c,v 1.7 1997/07/09 05:25:46 mikel Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)tty.c 8.2 (Berkeley) 4/20/95"; #else -static char rcsid[] = "$OpenBSD: tty.c,v 1.3 1997/07/13 21:21:17 millert Exp $"; +static char rcsid[] = "$OpenBSD: tty.c,v 1.4 1997/07/13 23:54:03 millert Exp $"; #endif #endif /* not lint */ @@ -83,9 +83,9 @@ grabh(hp, gflags) #ifdef __GNUC__ /* Avoid longjmp clobbering */ #ifdef TIOCSTI - (void) &extproc; + (void)&extproc; #endif - (void) &saveint; + (void)&saveint; #endif savetstp = signal(SIGTSTP, SIG_DFL); @@ -191,8 +191,8 @@ readtty(pr, src) char *cp, *cp2; #if __GNUC__ /* Avoid longjmp clobbering */ - (void) &c; - (void) &cp2; + (void)&c; + (void)&cp2; #endif fputs(pr, stdout); diff --git a/usr.bin/mail/vars.c b/usr.bin/mail/vars.c index 6110a4c3974..ab135c56b6e 100644 --- a/usr.bin/mail/vars.c +++ b/usr.bin/mail/vars.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vars.c,v 1.3 1997/07/13 21:21:18 millert Exp $ */ +/* $OpenBSD: vars.c,v 1.4 1997/07/13 23:54:03 millert Exp $ */ /* $NetBSD: vars.c,v 1.4 1996/06/08 19:48:45 christos Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)vars.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: vars.c,v 1.3 1997/07/13 21:21:18 millert Exp $"; +static char rcsid[] = "$OpenBSD: vars.c,v 1.4 1997/07/13 23:54:03 millert Exp $"; #endif #endif /* not lint */ @@ -64,7 +64,7 @@ assign(name, value) h = hash(name); vp = lookup(name); if (vp == NOVAR) { - vp = (struct var *) calloc(sizeof(*vp), 1); + vp = (struct var *)calloc(sizeof(*vp), 1); vp->v_name = vcopy(name); vp->v_link = variables[h]; variables[h] = vp; @@ -84,7 +84,7 @@ vfree(cp) char *cp; { if (*cp) - free(cp); + (void)free(cp); } /* @@ -102,9 +102,9 @@ vcopy(str) if (*str == '\0') return(""); len = strlen(str) + 1; - if ((new = malloc(len)) == NULL) + if ((new = (char *)malloc(len)) == NULL) panic("Out of memory"); - bcopy(str, new, (int) len); + (void)memcpy(new, str, len); return(new); } |