Replace rindex() with strrchr()
This commit is contained in:
+2
-2
@@ -65,13 +65,13 @@ iscsi_connect_async(struct iscsi_context *iscsi, const char *portal,
|
|||||||
host = addr;
|
host = addr;
|
||||||
|
|
||||||
/* check if we have a target portal group tag */
|
/* check if we have a target portal group tag */
|
||||||
str = rindex(host, ',');
|
str = strrchr(host, ',');
|
||||||
if (str != NULL) {
|
if (str != NULL) {
|
||||||
tpgt = atoi(str+1);
|
tpgt = atoi(str+1);
|
||||||
str[0] = 0;
|
str[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
str = rindex(host, ':');
|
str = strrchr(host, ':');
|
||||||
if (str != NULL) {
|
if (str != NULL) {
|
||||||
if (strchr(str, ']') == NULL) {
|
if (strchr(str, ']') == NULL) {
|
||||||
if (str != NULL) {
|
if (str != NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user