You have a global variable named 'pos' but the variable you try to use is named 'passwd_pos'. If those are supposed to be the same variable you should use the same name in both places.
You have a global variable named 'pos' but the variable you try to use is named 'passwd_pos'. If those are supposed to be the same variable you should use the same name in both places.