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
Usermode/libposix - Fixed bug in getpass (didn't trim \n)
[tpg/acess2.git]
/
Usermode
/
Libraries
/
libposix.so_src
/
unistd.c
diff --git
a/Usermode/Libraries/libposix.so_src/unistd.c
b/Usermode/Libraries/libposix.so_src/unistd.c
index
2d0a7e4
..
78896db
100644
(file)
--- a/
Usermode/Libraries/libposix.so_src/unistd.c
+++ b/
Usermode/Libraries/libposix.so_src/unistd.c
@@
-10,6
+10,7
@@
#include <stdarg.h>
#include <sys/select.h>
#include <stdio.h>
#include <stdarg.h>
#include <sys/select.h>
#include <stdio.h>
+#include <string.h>
// === CODE ===
int unlink(const char *pathname)
// === CODE ===
int unlink(const char *pathname)
@@
-182,6
+183,8
@@
char *getpass(const char *prompt)
fprintf(stderr, "%s", prompt);
fgets(passbuf, PASS_MAX+1, stdin);
fprintf(stderr, "\n");
fprintf(stderr, "%s", prompt);
fgets(passbuf, PASS_MAX+1, stdin);
fprintf(stderr, "\n");
+ for( int i = strlen(passbuf); i > 0 && (passbuf[i-1] == '\r' || passbuf[i-1] == '\n'); i -- )
+ passbuf[i-1] = 0;
return passbuf;
}
return passbuf;
}
UCC
git Repository :: git.ucc.asn.au