]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/vpnc/0006-config.c-Replace-deprecated-SUSv3-functions-with-POS.patch
lrzsz: install symlinks for XMODEM and YMODEM
[coffee/buildroot.git] / package / vpnc / 0006-config.c-Replace-deprecated-SUSv3-functions-with-POS.patch
1 From 627a45d88acf236cb36326919e4a2fa975c688bd Mon Sep 17 00:00:00 2001
2 From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
3 Date: Mon, 8 Feb 2016 23:05:23 +0100
4 Subject: [PATCH] config.c: Replace deprecated SUSv3 functions with POSIX
5  equivalents
6
7 Replace the deprecated SUSv3 function index() by its POSIX equivalent
8 strchr(). This is necessary to successfully build vpnc with uClibc,
9 when SUSv3 compatibility functions are not compiled in.
10
11 Patch originally from Bernhard Reutner-Fischer
12 <rep.dot.nop@gmail.com>.
13
14 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
15 ---
16
17  config.c | 3 +--
18  1 file changed, 1 insertion(+), 2 deletions(-)
19
20 diff --git a/config.c b/config.c
21 index 57778e3..11b363b 100644
22 --- a/config.c
23 +++ b/config.c
24 @@ -657,8 +657,7 @@ static const struct config_names_s {
25  static char *get_config_filename(const char *name, int add_dot_conf)
26  {
27         char *realname;
28 -
29 -       asprintf(&realname, "%s%s%s", index(name, '/') ? "" : "/etc/vpnc/", name, add_dot_conf ? ".conf" : "");
30 +       asprintf(&realname, "%s%s%s", strchr(name, '/') ? "" : "/etc/vpnc/", name, add_dot_conf ? ".conf" : "");
31         return realname;
32  }
33  
34 -- 
35 2.6.4
36