Mailing List Archive

[PATCH 6/9] config.c: Replace deprecated SUSv3 functions with POSIX equivalents
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>

Replace the deprecated SUSv3 function index() by its POSIX equivalent
strchr(). This is necessary to successfully build vpnc with uClibc,
when SUSv3 compatibility functions are not compiled in.

Patch originally from Bernhard Reutner-Fischer
<rep.dot.nop@gmail.com>.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
config.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/config.c b/config.c
index 57778e3..11b363b 100644
--- a/config.c
+++ b/config.c
@@ -657,8 +657,7 @@ static const struct config_names_s {
static char *get_config_filename(const char *name, int add_dot_conf)
{
char *realname;
-
- asprintf(&realname, "%s%s%s", index(name, '/') ? "" : "/etc/vpnc/", name, add_dot_conf ? ".conf" : "");
+ asprintf(&realname, "%s%s%s", strchr(name, '/') ? "" : "/etc/vpnc/", name, add_dot_conf ? ".conf" : "");
return realname;
}

--
2.7.4

_______________________________________________
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/