]> arthur.barton.de Git - bup.git/commitdiff
Replace use of index() with strchr
authorMuh Muhten <muh.muhten@gmail.com>
Thu, 27 Jan 2022 23:06:35 +0000 (18:06 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 1 May 2022 16:05:20 +0000 (11:05 -0500)
index() is a legacy string function formerly "equivalent to strchr", now
omitted from POSIX. This fixes builds on some newer libcs.

Signed-off-by: Muh Muhten <muh.muhten@gmail.com>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/cmd/bup.c

index 7f69291b6c402f946d66011389da4df15dad94b9..228276a6011b9f3b438677bdddaf4edc30474948 100644 (file)
@@ -225,7 +225,7 @@ static char *find_in_path(const char * const name, const char * const path)
 static char *find_exe_parent(const char * const argv_0)
 {
     char *candidate = NULL;
-    const char * const slash = index(argv_0, '/');
+    const char * const slash = strchr(argv_0, '/');
     if (slash) {
         candidate = strdup(argv_0);
         assert(candidate);