- printf("Password: ");
-
- // Read in text
- while( (ch = fgetc(stdin)) != -1 && ch != '\n' )
- {
- if(ch == '\b') {
- if( pos <= 0 ) continue;
- pos --;
- ret[pos] = '\0';
- }
- else
- ret[pos++] = ch;
-
- // Don't echo out to the screen
- //fputc(stdout, ch);
-
- if(pos == BUFLEN-1) break;
- }