[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH 04/15] partconf: util s/index/strchr/



"POSIX.1-2008 removes the specifications of index() and rindex(),
recommending strchr(3) and strchr(3) instead."

Signed-off-by: maximilian attems <max@stro.at>
---
 packages/partconf/util.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/packages/partconf/util.c b/packages/partconf/util.c
index e7ac89e..c9e0e1a 100644
--- a/packages/partconf/util.c
+++ b/packages/partconf/util.c
@@ -127,7 +127,7 @@ strcount(const char *s, int c)
     int ret = 0;
 
     p = s;
-    while ((p = index(p, c)) != NULL) {
+    while ((p = strchr(p, c)) != NULL) {
         ret++;
         p++;
     }
-- 
1.7.2.3


Reply to: