slang: make install-static do install-pkgconfig
[buildroot-gz.git] / package / nfs-utils / 0002-Switch-legacy-index-in-favour-of-strchr.patch
blob655d5342537b451ca1cc6d589940334939bca4fe
1 From a1d45736286939b822fcc7b9c74843f6f90a747e Mon Sep 17 00:00:00 2001
2 From: Gustavo Zacarias <gustavo@zacarias.com.ar>
3 Date: Sat, 10 Nov 2012 18:58:15 +0100
4 Subject: [PATCH] Switch legacy index() in favour of strchr() Updated for 1.2.6
5 from the previous patch by Frederik Pasch.
7 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
8 ---
9 support/nfs/nfs_mntent.c | 6 +++---
10 utils/mount/error.c | 2 +-
11 utils/mountd/fsloc.c | 2 +-
12 3 files changed, 5 insertions(+), 5 deletions(-)
14 diff --git a/support/nfs/nfs_mntent.c b/support/nfs/nfs_mntent.c
15 index a2118a2..7496ed6 100644
16 --- a/support/nfs/nfs_mntent.c
17 +++ b/support/nfs/nfs_mntent.c
18 @@ -9,7 +9,7 @@
21 #include <stdio.h>
22 -#include <string.h> /* for index */
23 +#include <string.h> /* for strchr */
24 #include <ctype.h> /* for isdigit */
25 #include <sys/stat.h> /* for umask */
26 #include <unistd.h> /* for ftruncate */
27 @@ -172,7 +172,7 @@ nfs_getmntent (mntFILE *mfp) {
28 return NULL;
30 mfp->mntent_lineno++;
31 - s = index (buf, '\n');
32 + s = strchr (buf, '\n');
33 if (s == NULL) {
34 /* Missing final newline? Otherwise extremely */
35 /* long line - assume file was corrupted */
36 @@ -180,7 +180,7 @@ nfs_getmntent (mntFILE *mfp) {
37 fprintf(stderr, _("[mntent]: warning: no final "
38 "newline at the end of %s\n"),
39 mfp->mntent_file);
40 - s = index (buf, 0);
41 + s = strchr (buf, 0);
42 } else {
43 mfp->mntent_errs = 1;
44 goto err;
45 diff --git a/utils/mount/error.c b/utils/mount/error.c
46 index e06f598..7bd1d27 100644
47 --- a/utils/mount/error.c
48 +++ b/utils/mount/error.c
49 @@ -62,7 +62,7 @@ static int rpc_strerror(int spos)
50 char *tmp;
52 if (estr) {
53 - if ((ptr = index(estr, ':')))
54 + if ((ptr = strchr(estr, ':')))
55 estr = ++ptr;
57 tmp = &errbuf[spos];
58 diff --git a/utils/mountd/fsloc.c b/utils/mountd/fsloc.c
59 index bc737d1..ddbe92f 100644
60 --- a/utils/mountd/fsloc.c
61 +++ b/utils/mountd/fsloc.c
62 @@ -127,7 +127,7 @@ static struct servers *method_list(char *data)
63 bool v6esc = false;
65 xlog(L_NOTICE, "method_list(%s)", data);
66 - for (ptr--, listsize=1; ptr; ptr=index(ptr, ':'), listsize++)
67 + for (ptr--, listsize=1; ptr; ptr=strchr(ptr, ':'), listsize++)
68 ptr++;
69 list = malloc(listsize * sizeof(char *));
70 copy = strdup(data);
72 2.1.0