change index/rindex to strchr/strrchr
authorJohn Kohl <jtkohl@mit.edu>
Mon, 29 Oct 1990 14:20:24 +0000 (14:20 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Mon, 29 Oct 1990 14:20:24 +0000 (14:20 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1361 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/get_krbhst.c
src/lib/krb5/os/hst_realm.c
src/lib/krb5/os/kuserok.c
src/lib/krb5/os/read_pwd.c

index f24bd5eba900cf2691f8b73ce4851b79a105d836..6845e9136b580d87b1261e008d3f824741b3827b 100644 (file)
@@ -105,11 +105,11 @@ char ***hostlist;
                break;
            }
            /* chop off remainder of line */
-           if (cp = index(rethlist[hlindex], ' '))
+           if (cp = strchr(rethlist[hlindex], ' '))
                *cp = '\0';
-           if (cp = index(rethlist[hlindex], '\t'))
+           if (cp = strchr(rethlist[hlindex], '\t'))
                *cp = '\0';
-           if (cp = index(rethlist[hlindex], '\n'))
+           if (cp = strchr(rethlist[hlindex], '\n'))
                *cp = '\0';
            if (++hlindex >= hlsize) {
                /* need larger pointer array */
index 0c6cb0e4a81712dfbe0cf355d9bbc36503cca198..20a184fad0356e84a64cdc0d28240c82815fe71a 100644 (file)
@@ -89,7 +89,7 @@ char ***realmsp;
 
     if (!(retrealms = (char **)calloc(2, sizeof(*retrealms))))
        return ENOMEM;
-    domain = index(host, '.');
+    domain = strchr(host, '.');
 
     /* prepare default */
     if (domain) {
index eb26f1c75e798e4abeb9e02195ff7766936dfaa4..dc3efe19c3272cec8740c72cd364290ed321bad2 100644 (file)
@@ -110,7 +110,7 @@ const char *luser;
        linebuf[BUFSIZ-1] = '\0';
        newline = NULL;
        /* nuke the newline if it exists */
-       if (newline = index(linebuf, '\n'))
+       if (newline = strchr(linebuf, '\n'))
            *newline = '\0';
        if (!strcmp(linebuf, princname)) {
            isok = TRUE;
index d1f2cd696f1dc09e91079339ebbde3d173b14c19..8d3118de3ae85568d0be415c344abf3577168abb 100644 (file)
@@ -119,7 +119,7 @@ int *size_return;
     /* fgets always null-terminates the returned string */
 
     /* replace newline with null */
-    if (ptr = index(return_pwd, '\n'))
+    if (ptr = strchr(return_pwd, '\n'))
        *ptr = '\0';
     else /* flush rest of input line */
        do {
@@ -146,7 +146,7 @@ int *size_return;
        }
        (void) putchar('\n');
 
-       if (ptr = index(readin_string, '\n'))
+       if (ptr = strchr(readin_string, '\n'))
            *ptr = '\0';
         else /* need to flush */
            do {