I have put that together from combining code from a few of the previous threads about masking passwords. The problem is that when I test it it ends up with a bunch of random characters at the end. How do I fix this?Code:void passgets(char pword[],int maxlength){ int counter=0; char ch; while((ch = getch())!='\r'&&counter<maxlength-1){ if(ch =='\b'&&counter>0){ printf("\b \b"); counter--; } else{ pword[counter++]=ch; putchar('*'); } } }
~Sven