summaryrefslogtreecommitdiff
path: root/usr.bin/mail/vars.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-07-13 21:21:19 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-07-13 21:21:19 +0000
commit2b3297f5b1693e36cc22413dbb7778992297f602 (patch)
tree1174dc315d74b189eb843566a157df312e1044a0 /usr.bin/mail/vars.c
parentea02c5005fcf76b2b6e8b3c847d6134492640cea (diff)
Merge in NetBSD and 4.4BSD-lite2 changes as well as some of my own.
- handle long lines safely (from NetBSD) - use puts/fputs and putchar/putc when it makes sense - use err/errx and warn/warnx when it makes sense - make return() and sizeof() style consisten - some more buffer safety
Diffstat (limited to 'usr.bin/mail/vars.c')
-rw-r--r--usr.bin/mail/vars.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/mail/vars.c b/usr.bin/mail/vars.c
index 22a1d9d8cf7..6110a4c3974 100644
--- a/usr.bin/mail/vars.c
+++ b/usr.bin/mail/vars.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vars.c,v 1.2 1996/06/11 12:53:53 deraadt Exp $ */
+/* $OpenBSD: vars.c,v 1.3 1997/07/13 21:21:18 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.2 1996/06/11 12:53:53 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: vars.c,v 1.3 1997/07/13 21:21:18 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;
@@ -100,12 +100,12 @@ vcopy(str)
unsigned len;
if (*str == '\0')
- return "";
+ return("");
len = strlen(str) + 1;
if ((new = malloc(len)) == NULL)
panic("Out of memory");
bcopy(str, new, (int) len);
- return new;
+ return(new);
}
/*
@@ -193,5 +193,5 @@ hash(name)
}
if (h < 0 && (h = -h) < 0)
h = 0;
- return (h % HSHSIZE);
+ return(h % HSHSIZE);
}