Replace rand() implementation - fixes threading lockups
[tpg/acess2.git] / Usermode / Applications / login_src / main.c
index 2866dbd..2bafe3b 100644 (file)
@@ -18,9 +18,10 @@ int main(int argc, char *argv[])
         int    status = 0;
        tUserInfo       *uinfo;
        
+       printf("\x1B[2J");      // Clear Screen
+
        for(;;)
        {
-               printf("\x1B[2J");      // Clear Screen
                // Validate User
                for(;;)
                {
@@ -45,6 +46,8 @@ int main(int argc, char *argv[])
                        return -1;
                }
                
+               printf("pid = %i\n", pid);
+               
                // Spawn shell in a child process
                if(pid == 0)
                {
@@ -87,6 +90,7 @@ char *GetUsername()
        while( (ch = fgetc(stdin)) != -1 && ch != '\n' )
        {
                if(ch == '\b') {
+                       if( pos <= 0 )  continue;
                        pos --;
                        ret[pos] = '\0';
                }
@@ -122,6 +126,7 @@ char *GetPassword()
        while( (ch = fgetc(stdin)) != -1 && ch != '\n' )
        {
                if(ch == '\b') {
+                       if( pos <= 0 )  continue;
                        pos --;
                        ret[pos] = '\0';
                }

UCC git Repository :: git.ucc.asn.au