summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfgsch <fgsch@openbsd.org>2000-06-20 08:59:52 +0000
committerfgsch <fgsch@openbsd.org>2000-06-20 08:59:52 +0000
commit8b21747adc1285997ef34905dc4d8813776792e3 (patch)
treeb37f63a7cf85b2b3787e4ef27ada3a3d637f78b6
parentadd OpenBSD tag. (diff)
downloadwireguard-openbsd-8b21747adc1285997ef34905dc4d8813776792e3.tar.xz
wireguard-openbsd-8b21747adc1285997ef34905dc4d8813776792e3.zip
fix warnings during compilation. replace a few more calloc's with
malloc's; no need to clean the buffer for fgets.
-rw-r--r--usr.bin/tcfs/tcfsaddgroup.c8
-rw-r--r--usr.bin/tcfs/tcfsadduser.c4
-rw-r--r--usr.bin/tcfs/tcfsgenkey.c4
-rw-r--r--usr.bin/tcfs/tcfsputkey.c6
-rw-r--r--usr.bin/tcfs/tcfsrmgroup.c8
-rw-r--r--usr.bin/tcfs/tcfsrmkey.c10
-rw-r--r--usr.bin/tcfs/tcfsrmuser.c4
7 files changed, 25 insertions, 19 deletions
diff --git a/usr.bin/tcfs/tcfsaddgroup.c b/usr.bin/tcfs/tcfsaddgroup.c
index ddbe08e6fdb..bad57050656 100644
--- a/usr.bin/tcfs/tcfsaddgroup.c
+++ b/usr.bin/tcfs/tcfsaddgroup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsaddgroup.c,v 1.10 2000/06/20 06:45:16 fgsch Exp $ */
+/* $OpenBSD: tcfsaddgroup.c,v 1.11 2000/06/20 08:59:52 fgsch Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -169,10 +169,10 @@ int
addgroup_main(int argn, char *argv[])
{
int val;
- gid_t gid;
+ gid_t gid = 0;
int have_gid = FALSE, have_members = FALSE, have_threshold = FALSE;
int be_verbose = FALSE;
- int temp_members, members;
+ int temp_members, members = 0;
tcfsgpwdb **group_info;
/*
@@ -222,7 +222,7 @@ addgroup_main(int argn, char *argv[])
char *buff = NULL;
int len;
- buff = (char *)calloc(2048, sizeof(char));
+ buff = (char *)malloc(2048);
if (!buff)
tcfs_error(ER_MEM, NULL);
diff --git a/usr.bin/tcfs/tcfsadduser.c b/usr.bin/tcfs/tcfsadduser.c
index 0c472cb78a7..5418b62c0b2 100644
--- a/usr.bin/tcfs/tcfsadduser.c
+++ b/usr.bin/tcfs/tcfsadduser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsadduser.c,v 1.6 2000/06/20 06:45:16 fgsch Exp $ */
+/* $OpenBSD: tcfsadduser.c,v 1.7 2000/06/20 08:59:53 fgsch Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -95,4 +95,6 @@ adduser_main(int argn, char *argv[])
printf("User entry created with success.\n");
tcfs_error(OK, NULL);
+
+ exit(0);
}
diff --git a/usr.bin/tcfs/tcfsgenkey.c b/usr.bin/tcfs/tcfsgenkey.c
index c5b1aa1b7c7..5ac39401ad2 100644
--- a/usr.bin/tcfs/tcfsgenkey.c
+++ b/usr.bin/tcfs/tcfsgenkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsgenkey.c,v 1.8 2000/06/20 06:45:16 fgsch Exp $ */
+/* $OpenBSD: tcfsgenkey.c,v 1.9 2000/06/20 08:59:53 fgsch Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -106,4 +106,6 @@ genkey_main(int argn, char *argv[])
tcfs_error(ER_CUSTOM, "Error: cannot generate key.");
tcfs_error(ER_CUSTOM, "\nKey succesfully generated.");
+
+ exit(0);
}
diff --git a/usr.bin/tcfs/tcfsputkey.c b/usr.bin/tcfs/tcfsputkey.c
index 177993d6862..2266c467a37 100644
--- a/usr.bin/tcfs/tcfsputkey.c
+++ b/usr.bin/tcfs/tcfsputkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsputkey.c,v 1.9 2000/06/20 01:29:14 provos Exp $ */
+/* $OpenBSD: tcfsputkey.c,v 1.10 2000/06/20 08:59:53 fgsch Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -37,8 +37,8 @@ putkey_main(int argc, char *argv[])
{
char *user, *password, *tcfskey;
uid_t uid;
- gid_t gid;
- int es, treshold;
+ gid_t gid = 0;
+ int es = 0, treshold;
char x;
tcfspwdb *info;
tcfsgpwdb *ginfo;
diff --git a/usr.bin/tcfs/tcfsrmgroup.c b/usr.bin/tcfs/tcfsrmgroup.c
index 03ad2b0c213..d64bd06223d 100644
--- a/usr.bin/tcfs/tcfsrmgroup.c
+++ b/usr.bin/tcfs/tcfsrmgroup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsrmgroup.c,v 1.8 2000/06/20 06:45:16 fgsch Exp $ */
+/* $OpenBSD: tcfsrmgroup.c,v 1.9 2000/06/20 08:59:53 fgsch Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -31,7 +31,7 @@ int
rmgroup_main(int argn, char *argv[])
{
int val;
- gid_t gid;
+ gid_t gid = 0;
int have_gid = FALSE, be_verbose = FALSE;
/*
@@ -71,7 +71,7 @@ rmgroup_main(int argn, char *argv[])
char *buff = NULL;
int len;
- buff = (char *)calloc(2048, sizeof(char));
+ buff = (char *)malloc(2048);
if (!buff)
tcfs_error(ER_MEM, NULL);
@@ -98,4 +98,6 @@ rmgroup_main(int argn, char *argv[])
if (!tcfs_rmgroup(gid))
tcfs_error(ER_CUSTOM, "Wrong ID or an error as occurred.\n");
+
+ exit(0);
}
diff --git a/usr.bin/tcfs/tcfsrmkey.c b/usr.bin/tcfs/tcfsrmkey.c
index e39df753b96..3ab8b054c32 100644
--- a/usr.bin/tcfs/tcfsrmkey.c
+++ b/usr.bin/tcfs/tcfsrmkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsrmkey.c,v 1.5 2000/06/20 01:29:14 provos Exp $ */
+/* $OpenBSD: tcfsrmkey.c,v 1.6 2000/06/20 08:59:53 fgsch Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -36,8 +36,8 @@ int
rmkey_main(int argc, char *argv[])
{
uid_t uid;
- gid_t gid;
- int es;
+ gid_t gid = 0;
+ int es = 0;
char x;
char fslabel[MAXPATHLEN], fspath[MAXPATHLEN];
int havempname = FALSE, havefsname = FALSE, isgroupkey = FALSE;
@@ -73,10 +73,8 @@ rmkey_main(int argc, char *argv[])
if (argc-optind)
tcfs_error(ER_UNKOPT, NULL);
- if (havefsname && havempname) {
+ if (havefsname && havempname)
tcfs_error(ER_CUSTOM, rmkey_usage);
- exit(1);
- }
if (havefsname) {
es = tcfs_getfspath(fslabel, fspath);
diff --git a/usr.bin/tcfs/tcfsrmuser.c b/usr.bin/tcfs/tcfsrmuser.c
index ac7bc1a6e27..563cd48be5e 100644
--- a/usr.bin/tcfs/tcfsrmuser.c
+++ b/usr.bin/tcfs/tcfsrmuser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsrmuser.c,v 1.7 2000/06/20 06:45:16 fgsch Exp $ */
+/* $OpenBSD: tcfsrmuser.c,v 1.8 2000/06/20 08:59:53 fgsch Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -103,4 +103,6 @@ rmuser_main(int argn, char *argv[])
printf("User entry removed with success.\n");
tcfs_error(OK, NULL);
+
+ exit(0);
}