I am having an interesting problem involving calling strlen - it's causing my program to stop responding. I've isolated it down to just that one line. Funny thing is that I use it a little bit before in the code seemingly the same and I have no problems. The line in bold is the problem line:

Code:
[...]
} else if(aa[ii][0] == '>') {

            // push
            if(ii == stackSize) {
                fprintf(stderr, "Full stack.\n");
            } else {
                printf(strlen(aa[ii]));
                ii++;
            }

}
[...]
aa[ii] is a string of user input. I know that aa[ii] has a legitimate value. Here is a bigger chunk of code if you need it:

Code:
    int cc;
    ii = 0;
    for(cc = 0; cc < 1; cc--) { // infinite loop
        if(fgets(aa[ii], LINE_SZ, stdin) == NULL)
            exit(0);

        if(strlen(aa[ii]) > 80) {

            fprintf(stderr, "Bad input.\n");    
    
        } else if(aa[ii][0] == '<') {

            // pop
            if(ii == 0) {
                fprintf(stderr, "Empty stack.\n");
            } else {
                printf(aa[ii-1]);
            }

        } else if(aa[ii][0] == '>') {

            // push
            if(ii == stackSize) {
                fprintf(stderr, "Full stack.\n");
            } else {
                printf(strlen(aa[ii]));
                ii++;
            }

        } else {

            // bad input
            printf("Bad input.\n");

        } 

                
    }
Before that chunk I call
Code:
arg_length = strlen(argv[1]);
and it works fine. I don't understand what is causing my program to freeze (I run it through the command prompt on windows xp, and when it reaches that line it stops responding and gives me that 'this program stopped responding and needs to be shut down' message). And I know it is exactly that line because I isolated it doing error tests.

Any idea? Thanks!