mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-06 16:15:23 -04:00
fixed compilation in new getpass method
This commit is contained in:
parent
af65ac1aa8
commit
f182b358f4
2 changed files with 10 additions and 2 deletions
|
@ -20,12 +20,15 @@
|
|||
|
||||
#ifndef __ANDROID__
|
||||
|
||||
#include <util/rskbdinput.h>
|
||||
|
||||
#ifdef WINDOWS_SYS
|
||||
#include <conio.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define PASS_MAX 512
|
||||
|
||||
namespace RsUtil {
|
||||
std::string rs_getpass(const std::string& prompt,bool no_echo)
|
||||
{
|
||||
static char getpassbuf [PASS_MAX + 1];
|
||||
|
@ -60,6 +63,7 @@ std::string rs_getpass(const std::string& prompt,bool no_echo)
|
|||
|
||||
return std::string(getpassbuf);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -84,7 +88,9 @@ static int getch()
|
|||
return ch;
|
||||
}
|
||||
|
||||
std::string rs_getpass(const char *prompt, bool no_echo)
|
||||
namespace RsUtil {
|
||||
|
||||
std::string rs_getpass(const std::string& prompt, bool no_echo)
|
||||
{
|
||||
const char BACKSPACE=127;
|
||||
const char RETURN=10;
|
||||
|
@ -118,6 +124,6 @@ std::string rs_getpass(const char *prompt, bool no_echo)
|
|||
|
||||
return std::string(password);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace RsUtil {
|
||||
|
||||
std::string rs_getpass(const std::string& prompt,bool no_echo=true) ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue