Mailing List Archive

[PATCH] add assertion and fix warnings
---
trunk/tunip.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/trunk/tunip.c b/trunk/tunip.c
index 20e793a..e2ab9e2 100644
--- a/trunk/tunip.c
+++ b/trunk/tunip.c
@@ -53,6 +53,7 @@
*
*/

+#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/socket.h>
#include <errno.h>
@@ -985,7 +986,7 @@ void vpnc_doit(struct sa_block *s)
struct encap_method meth;

const char *pidfile = config[CONFIG_PID_FILE];
- const char *cwd;
+ char *cwd;

switch (s->ipsec.encap_mode) {
case IPSEC_ENCAP_TUNNEL:
@@ -1041,6 +1042,8 @@ void vpnc_doit(struct sa_block *s)

/* save cwd */
cwd = get_current_dir_name();
+ assert(cwd != NULL);
+
chdir("/");

if (!opt_nd) {
--
2.9.2

_______________________________________________
vpnc-devel mailing list
vpnc-devel@unix-ag.uni-kl.de
https://lists.unix-ag.uni-kl.de/mailman/listinfo/vpnc-devel
http://www.unix-ag.uni-kl.de/~massar/vpnc/