git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Modules/Tegra2Vid - Fixed out-of-date IO function prototypes
[tpg/acess2.git]
/
Usermode
/
Applications
/
login_src
/
main.c
diff --git
a/Usermode/Applications/login_src/main.c
b/Usermode/Applications/login_src/main.c
index
e151ff9
..
86b1884
100644
(file)
--- a/
Usermode/Applications/login_src/main.c
+++ b/
Usermode/Applications/login_src/main.c
@@
-29,9
+29,12
@@
int main(int argc, char *argv[])
for(;;)
{
sUsername = GetUsername();
for(;;)
{
sUsername = GetUsername();
- if(!sUsername
)
continue;
+ if(!sUsername
|| !sUsername[0])
continue;
sPassword = GetPassword();
sPassword = GetPassword();
- if(!sPassword) continue;
+ if(!sPassword) {
+ free(sUsername);
+ continue;
+ }
if( (uid = ValidateUser(sUsername, sPassword)) == -1 )
{
printf("\nInvalid username or password\n");
if( (uid = ValidateUser(sUsername, sPassword)) == -1 )
{
printf("\nInvalid username or password\n");
@@
-61,6
+64,11
@@
int main(int argc, char *argv[])
// Wait for child to terminate
_SysWaitTID(pid, &status);
// Wait for child to terminate
_SysWaitTID(pid, &status);
+
+ // Clear graphics mode
+ struct ptymode mode = {.InputMode = PTYIMODE_ECHO|PTYIMODE_CANON,.OutputMode=0};
+ _SysIOCtl(0, PTY_IOCTL_SETMODE, &mode);
+ fprintf(stderr, "\x1b[R");
}
return 0;
}
return 0;
@@
-113,7
+121,7
@@
char *_GetString(int bEcho)
mode.InputMode |= PTYIMODE_ECHO;
_SysIOCtl(0, PTY_IOCTL_SETMODE, &mode);
}
mode.InputMode |= PTYIMODE_ECHO;
_SysIOCtl(0, PTY_IOCTL_SETMODE, &mode);
}
-
+
return strdup(ret);
}
return strdup(ret);
}
UCC
git Repository :: git.ucc.asn.au