Replace rindex() with strrchr()

This commit is contained in:
Ronnie Sahlberg
2011-01-09 09:47:39 +11:00
parent 5e11bb17b1
commit b9ad4beb41
+2 -2
View File
@@ -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) {