projects
/
mmh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bb150a8
)
Fix some compile-time warnings.
author
Shantonu Sen
<ssen@mit.edu>
Tue, 9 May 2000 06:09:05 +0000
(06:09 +0000)
committer
Shantonu Sen
<ssen@mit.edu>
Tue, 9 May 2000 06:09:05 +0000
(06:09 +0000)
sbr/getpass.c
patch
|
blob
|
history
sbr/ruserpass.c
patch
|
blob
|
history
diff --git
a/sbr/getpass.c
b/sbr/getpass.c
index
6a53b72
..
cca32f6
100644
(file)
--- a/
sbr/getpass.c
+++ b/
sbr/getpass.c
@@
-30,11
+30,10
@@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $ID$
+ * $Id$
*/
#include <stdio.h>
*/
#include <stdio.h>
-#include <unistd.h>
#include <termios.h>
#define PASSWORD_LEN 128
#include <termios.h>
#define PASSWORD_LEN 128
@@
-43,18
+42,22
@@
#define TCSANOW 0
#endif
#define TCSANOW 0
#endif
-char *getpass(const char *prompt)
+char *
+getpass(char *prompt)
{
struct termios oterm, term;
{
struct termios oterm, term;
- int ch;
- char *p, *ttystring, buf[PASSWORD_LEN+1];
+ char ch;
+ char *p, *ttystring, *buf;
FILE *fout, *fin;
FILE *fout, *fin;
+ if(!(buf = (char *)calloc((size_t)(PASSWORD_LEN+1), sizeof(char))))
+ adios(NULL, "unable to allocate string storage");
+
/* Find if stdin is connect to a terminal. If so, read directly from
* the terminal, and turn off echo. Otherwise read from stdin.
*/
/* Find if stdin is connect to a terminal. If so, read directly from
* the terminal, and turn off echo. Otherwise read from stdin.
*/
- if((ttystring = ttyname(fileno(stdin))) == NULL) {
+ if((ttystring = (char *)ttyname(fileno(stdin))) == NULL) {
fout = stderr;
fin = stdin;
}
fout = stderr;
fin = stdin;
}
@@
-80,5
+83,5
@@
char *getpass(const char *prompt)
(void)fputc('\n', fout);
(void)fclose(fin);
}
(void)fputc('\n', fout);
(void)fclose(fin);
}
- return(buf);
+ return((char *)buf);
}
}
diff --git
a/sbr/ruserpass.c
b/sbr/ruserpass.c
index
68809df
..
085d493
100644
(file)
--- a/
sbr/ruserpass.c
+++ b/
sbr/ruserpass.c
@@
-162,7
+162,7
@@
done:
char *mypass;
snprintf(prompt, sizeof(prompt), "Password (%s:%s): ", host, *aname);
char *mypass;
snprintf(prompt, sizeof(prompt), "Password (%s:%s): ", host, *aname);
- mypass = getpass (prompt);
+ mypass = (char *)getpass (prompt);
if (*mypass == '\0') {
mypass = *aname;
if (*mypass == '\0') {
mypass = *aname;