summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjca <jca@openbsd.org>2020-02-11 18:16:38 +0000
committerjca <jca@openbsd.org>2020-02-11 18:16:38 +0000
commitb922e4d52baa56da18fb97d21f76aece9a6113d7 (patch)
treeafd23b328341bd5c3740efce8fa59ddb68b11c5e
parentPretty sure sha1 works most of the time, no need to check during (diff)
downloadwireguard-openbsd-b922e4d52baa56da18fb97d21f76aece9a6113d7.tar.xz
wireguard-openbsd-b922e4d52baa56da18fb97d21f76aece9a6113d7.zip
Initialize rejecttype to appease static analyzers
-t has already been checked in main() and can only be "blk" or "noblk", but static analyzers like scan-build fail to spot this. From miod@
-rw-r--r--sbin/swapctl/swapctl.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sbin/swapctl/swapctl.c b/sbin/swapctl/swapctl.c
index f45ab4f66b7..503db25cdb2 100644
--- a/sbin/swapctl/swapctl.c
+++ b/sbin/swapctl/swapctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: swapctl.c,v 1.25 2019/12/05 12:46:54 mpi Exp $ */
+/* $OpenBSD: swapctl.c,v 1.26 2020/02/11 18:16:38 jca Exp $ */
/* $NetBSD: swapctl.c,v 1.9 1998/07/26 20:23:15 mycroft Exp $ */
/*
@@ -332,7 +332,7 @@ do_fstab(void)
char *s;
long priority;
struct stat st;
- mode_t rejecttype;
+ mode_t rejecttype = 0;
int gotone = 0;
/*
@@ -344,8 +344,7 @@ do_fstab(void)
rejecttype = S_IFREG;
else if (strcmp(tflag, "noblk") == 0)
rejecttype = S_IFBLK;
- } else
- rejecttype = 0;
+ }
#define PRIORITYEQ "priority="
#define NFSMNTPT "nfsmntpt="