fileparse.c
/*
 * Create a line of random characters
 * Line will be ll long and appears in l
 * Randomly, phrase contained in sp and of sp_len length will be added to l at a random position
 */
Create a line of random characters
Line will be ll long and appears in l
Randomly, phrase contained in sp and of sp_len length will be added to l at a random position
Create a line of random characters Line will be ll long and appears in l Randomly phrase contained in sp and of sp_len length will be added to l at a random position
int create_line(char* sp, size_t sp_len, char* l, unsigned int ll) {
    int i = 0;
    int r = 0;
    int flag = 0;
    for (i = 0; i < ll; i++) {
        r = (rand() % 128);
        while (!isalnum(r)) {
            r = (rand() % 128);
        }
        l[i] = (char) r;
    }
    l[i + 1] = '\0';
    r = rand() % 2;
    if (r == 0) {
        flag = 0;
        r = rand() % (ll - sp_len);
        for (i = 0; i < sp_len; i++) {
            l[r + i] = sp[i];
        }
    } else {
        flag = 1;
    }
    return flag;
}
int create_line ( char * sp , size_t sp_len , char * l , unsigned int ll ) { int i = 0 ; int r = 0 ; int flag = 0 ; for ( i = 0 ; i < ll ; i ++ ) { r = ( rand ( ) % 128 ) ; while ( ! isalnum ( r ) ) { r = ( rand ( ) % 128 ) ; } l [ i ] = ( char ) r ; } l [ i + 1 ] = ' \0 ' ; r = rand ( ) % 2 ; if ( r == 0 ) { flag = 0 ; r = rand ( ) % ( ll - sp_len ) ; for ( i = 0 ; i < sp_len ; i ++ ) { l [ r + i ] = sp [ i ] ; } } else { flag = 1 ; } return flag ; }
Create a line of random characters
 Line will be ll long and appears in l
 Randomly, phrase contained in sp and of sp_len length will be added to l at a random position
Create a line of random characters Line will be ll long and appears in l Randomly phrase contained in sp and of sp_len length will be added to l at a random position