67 lines
1.4 KiB
Diff
67 lines
1.4 KiB
Diff
|
From 71526cbf754cbf9ee5ff65babc4ccd3808fa8026 Mon Sep 17 00:00:00 2001
|
||
|
Date: Tue, 24 Sep 2019 23:12:58 +0300
|
||
|
Subject: [PATCH] index -> strchr for new glibc
|
||
|
|
||
|
index is deprecated, strchr is used instead
|
||
|
---
|
||
|
ksym_mod.c | 10 +++++-----
|
||
|
syslog.c | 2 +-
|
||
|
2 files changed, 6 insertions(+), 6 deletions(-)
|
||
|
|
||
|
diff --git a/ksym_mod.c b/ksym_mod.c
|
||
|
index 68cd6b6..d1c0836 100644
|
||
|
--- a/ksym_mod.c
|
||
|
+++ b/ksym_mod.c
|
||
|
@@ -199,10 +199,10 @@ extern int InitMsyms()
|
||
|
|
||
|
while ( fgets(buf, sizeof(buf), ksyms) != NULL )
|
||
|
{
|
||
|
- if (num_syms > 0 && index(buf, '[') == NULL)
|
||
|
+ if (num_syms > 0 && strchr(buf, '[') == NULL)
|
||
|
continue;
|
||
|
|
||
|
- p = index(buf, ' ');
|
||
|
+ p = strchr(buf, ' ');
|
||
|
|
||
|
if ( p == NULL )
|
||
|
continue;
|
||
|
@@ -399,11 +399,11 @@ static int AddSymbol(line)
|
||
|
static char *lastmodule = NULL;
|
||
|
struct Module *mp;
|
||
|
|
||
|
- module = index(line, '[');
|
||
|
+ module = strchr(line, '[');
|
||
|
|
||
|
if ( module != NULL )
|
||
|
{
|
||
|
- p = index(module, ']');
|
||
|
+ p = strchr(module, ']');
|
||
|
|
||
|
if ( p != NULL )
|
||
|
*p = '\0';
|
||
|
@@ -414,7 +414,7 @@ static int AddSymbol(line)
|
||
|
*(++p) = '\0';
|
||
|
}
|
||
|
|
||
|
- p = index(line, ' ');
|
||
|
+ p = strchr(line, ' ');
|
||
|
|
||
|
if ( p == NULL )
|
||
|
return(0);
|
||
|
diff --git a/syslog.c b/syslog.c
|
||
|
index bdb3ff2..9239b68 100644
|
||
|
--- a/syslog.c
|
||
|
+++ b/syslog.c
|
||
|
@@ -191,7 +191,7 @@ vsyslog(pri, fmt, ap)
|
||
|
return;
|
||
|
(void)strcat(tbuf, "\r\n");
|
||
|
cnt += 2;
|
||
|
- p = index(tbuf, '>') + 1;
|
||
|
+ p = strchr(tbuf, '>') + 1;
|
||
|
(void)write(fd, p, cnt - (p - tbuf));
|
||
|
(void)close(fd);
|
||
|
}
|
||
|
--
|
||
|
1.9.5
|
||
|
|