misc: replace index() with strchr()

Type: improvement
Change-Id: I471e514ebef0b4c1f86067115b2ebe5a5517c6fb
Signed-off-by: Matus Fabian <matfabia@cisco.com>
diff --git a/src/vlib/format.c b/src/vlib/format.c
index 7de6417..9801062 100644
--- a/src/vlib/format.c
+++ b/src/vlib/format.c
@@ -198,7 +198,7 @@
     return 0;
 
   /* Brain-police user path input */
-  if (strstr ((char *) filename, "..") || index ((char *) filename, '/'))
+  if (strstr ((char *) filename, "..") || strchr ((char *) filename, '/'))
     {
       vec_free (filename);
       return 0;
diff --git a/src/vlib/main.c b/src/vlib/main.c
index 04b5876..8f87df9 100644
--- a/src/vlib/main.c
+++ b/src/vlib/main.c
@@ -655,7 +655,7 @@
     }
 
   /* It's fairly hard to get "../oopsie" through unformat; just in case */
-  if (strstr (file, "..") || index (file, '/'))
+  if (strstr (file, "..") || strchr (file, '/'))
     {
       vlib_cli_output (vm, "illegal characters in filename '%s'", file);
       return 0;