Blame view

buildroot/buildroot-2016.08.1/package/vpnc/0006-config.c-Replace-deprecated-SUSv3-functions-with-POS.patch 1.12 KB
6b13f685e   김민수   BSP 최초 추가
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  From 627a45d88acf236cb36326919e4a2fa975c688bd Mon Sep 17 00:00:00 2001
  From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
  Date: Mon, 8 Feb 2016 23:05:23 +0100
  Subject: [PATCH] config.c: Replace deprecated SUSv3 functions with POSIX
   equivalents
  
  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.6.4