summaryrefslogtreecommitdiffstats
path: root/usr.bin/sendbug/sendbug.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2007-03-23 02:11:00 +0000
committerderaadt <deraadt@openbsd.org>2007-03-23 02:11:00 +0000
commit70dfcc75e85c8fce63148df379ea47e62c0e5510 (patch)
tree5af33b7621c22c415fafd6171ab2e94e0fe02392 /usr.bin/sendbug/sendbug.c
parentImport public domain rewrite of sendbug, written by Ray Lai. =) (diff)
downloadwireguard-openbsd-70dfcc75e85c8fce63148df379ea47e62c0e5510.tar.xz
wireguard-openbsd-70dfcc75e85c8fce63148df379ea47e62c0e5510.zip
some minor KNF, including sentinals; ok ray
Diffstat (limited to 'usr.bin/sendbug/sendbug.c')
-rw-r--r--usr.bin/sendbug/sendbug.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/sendbug/sendbug.c b/usr.bin/sendbug/sendbug.c
index aeac2dcd9bd..da9e0c17504 100644
--- a/usr.bin/sendbug/sendbug.c
+++ b/usr.bin/sendbug/sendbug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sendbug.c,v 1.1.1.1 2007/03/23 01:47:11 ray Exp $ */
+/* $OpenBSD: sendbug.c,v 1.2 2007/03/23 02:11:00 deraadt Exp $ */
/*
* Written by Ray Lai <ray@cyth.net>.
@@ -40,12 +40,12 @@ char *fullname;
int
main(int argc, char *argv[])
{
- struct stat sb;
- FILE *fp;
const char *editor, *tmpdir;
char *tmppath = NULL;
- time_t mtime;
int c, fd, ret = 1;
+ struct stat sb;
+ time_t mtime;
+ FILE *fp;
if ((tmpdir = getenv("TMPDIR")) == NULL || tmpdir[0] == '\0')
tmpdir = _PATH_TMP;
@@ -79,7 +79,7 @@ main(int argc, char *argv[])
warn("fork");
goto cleanup;
case 0:
- execlp(editor, editor, tmppath, NULL);
+ execlp(editor, editor, tmppath, (void *)NULL);
err(1, "execlp");
default:
wait(NULL);
@@ -161,7 +161,7 @@ sendmail(const char *tmppath)
}
close(filedes[0]);
execl("/usr/sbin/sendmail", "sendmail",
- "-oi", "-t", NULL);
+ "-oi", "-t", (void *)NULL);
warn("sendmail error: unsent report in %s",
tmppath);
return (-1);
@@ -230,10 +230,10 @@ init(void)
int
send_file(const char *file, int dst)
{
- FILE *fp;
- char *buf;
- size_t len;
int blank = 0;
+ size_t len;
+ char *buf;
+ FILE *fp;
if ((fp = fopen(file, "r")) == NULL)
return (-1);