Password input program

N

neilsolent

Hi

The following test program is supposed to wait for the user to input a
password, then echo it to the screen. It works fine on Solaris 10.
However, on Linux it clears the screen first! Can anyone explain how I
can modify it to work (not clear the screen) on Linux?

Thanks!

///////////////////////////////////////////////


#include <curses.h>

int main(int argc, char* argv[])
{
char buffer[16];
filter();
WINDOW* win = initscr();
noecho();
wgetnstr(win, buffer, 15);
endwin();
buffer[15] = 0;
printf("%s\n", buffer);
return 0;
}
 
I

Ian Collins

neilsolent said:
Hi

The following test program is supposed to wait for the user to input a
password, then echo it to the screen. It works fine on Solaris 10.
However, on Linux it clears the screen first! Can anyone explain how I
can modify it to work (not clear the screen) on Linux?
Try comp.unix.programmer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,216
Latest member
topweb3twitterchannels

Latest Threads

Top