1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

make: replace legacy use rindex with strrchr

Seems already dropped by some systems.

Reported-by: adamboardman of gemian
This commit is contained in:
Zdenek Kabelac 2021-09-24 17:40:35 +02:00
parent e585c10fad
commit 9971459d19
3 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;