kernel/src/klibc/klibc.c
os_size_t os_strcspn(char * s, char * reject) {
    char c = s[0];  // The character in s being checked
    int length = 0;

    // Check each character in s
    while (c != 0) {
        // Check against each character in reject
        int i;
        for (i = 0; i < strlen(reject); i++) {
            if (c == reject[i]) { return length; }
        }

        // If c did not match any reject characters, continue
        length++;
        c = s[length];
    }
    return length;
}
/* Returns the length of the initial segment of s that does not contain
 any characters in string c.
 */
Returns the length of the initial segment of s that does not contain
any characters in string c.
Returns the length of the initial segment of s that does not contain any characters in string c .
os_size_t os_strcspn(char * s, char * reject) {
    char c = s[0];  
    int length = 0;
    while (c != 0) {
        int i;
        for (i = 0; i < strlen(reject); i++) {
            if (c == reject[i]) { return length; }
        }
        length++;
        c = s[length];
    }
    return length;
}
os_size_t os_strcspn ( char * s , char * reject ) { char c = s [ 0 ] ; int length = 0 ; while ( c != 0 ) { int i ; for ( i = 0 ; i < strlen ( reject ) ; i ++ ) { if ( c == reject [ i ] ) { return length ; } } length ++ ; c = s [ length ] ; } return length ; }
Returns the length of the initial segment of s that does not contain
any characters in string c.
Returns the length of the initial segment of s that does not contain any characters in string c .
// The character in s being checked // Check each character in s // Check against each character in reject // If c did not match any reject characters, continue