From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - make: replace legacy use rindex with strrchr
Date: Mon, 27 Sep 2021 16:57:49 +0000 (GMT) [thread overview]
Message-ID: <20210927165749.DB229385840B@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9971459d19e93ff652eeaff165da72e51b256299
Commit: 9971459d19e93ff652eeaff165da72e51b256299
Parent: e585c10fade006e5fe3643b76b09501d54c20c9b
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Fri Sep 24 17:40:35 2021 +0200
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Mon Sep 27 18:56:14 2021 +0200
make: replace legacy use rindex with strrchr
Seems already dropped by some systems.
Reported-by: adamboardman of gemian
---
device_mapper/libdm-deptree.c | 2 +-
lib/activate/dev_manager.c | 2 +-
libdm/libdm-deptree.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/device_mapper/libdm-deptree.c b/device_mapper/libdm-deptree.c
index a0f386e77..e4bf4c814 100644
--- a/device_mapper/libdm-deptree.c
+++ b/device_mapper/libdm-deptree.c
@@ -604,7 +604,7 @@ static struct dm_tree_node *_find_dm_tree_node_by_uuid(struct dm_tree *dtree,
default_uuid_prefix = dm_uuid_prefix();
default_uuid_prefix_len = strlen(default_uuid_prefix);
- if (suffix_list && (suffix_position = rindex(uuid, '-'))) {
+ if (suffix_list && (suffix_position = strrchr(uuid, '-'))) {
while ((suffix = suffix_list[i++])) {
if (strcmp(suffix_position + 1, suffix))
continue;
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index a8516d661..a73a556b2 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -838,7 +838,7 @@ static int _info(struct cmd_context *cmd,
return 1;
/* Check for original version of dlid before the suffixes got added in 2.02.106 */
- if ((suffix_position = rindex(dlid, '-'))) {
+ if ((suffix_position = strrchr(dlid, '-'))) {
while ((suffix = uuid_suffix_list[i++])) {
if (strcmp(suffix_position + 1, suffix))
continue;
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index d7fb5ef13..c14b6ef56 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -566,7 +566,7 @@ static struct dm_tree_node *_find_dm_tree_node_by_uuid(struct dm_tree *dtree,
default_uuid_prefix = dm_uuid_prefix();
default_uuid_prefix_len = strlen(default_uuid_prefix);
- if (suffix_list && (suffix_position = rindex(uuid, '-'))) {
+ if (suffix_list && (suffix_position = strrchr(uuid, '-'))) {
while ((suffix = suffix_list[i++])) {
if (strcmp(suffix_position + 1, suffix))
continue;
reply other threads:[~2021-09-27 16:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210927165749.DB229385840B@sourceware.org \
--to=zkabelac@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.