for (int i=0; i < randlen; i++) { strbuf[i] = (rand()%26)+97; strbuf[i] = '\0'; }