mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-26 15:28:28 -05:00
fixed compilation in new getpass method
This commit is contained in:
parent
af65ac1aa8
commit
f182b358f4
@ -20,12 +20,15 @@
|
|||||||
|
|
||||||
#ifndef __ANDROID__
|
#ifndef __ANDROID__
|
||||||
|
|
||||||
|
#include <util/rskbdinput.h>
|
||||||
|
|
||||||
#ifdef WINDOWS_SYS
|
#ifdef WINDOWS_SYS
|
||||||
#include <conio.h>
|
#include <conio.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#define PASS_MAX 512
|
#define PASS_MAX 512
|
||||||
|
|
||||||
|
namespace RsUtil {
|
||||||
std::string rs_getpass(const std::string& prompt,bool no_echo)
|
std::string rs_getpass(const std::string& prompt,bool no_echo)
|
||||||
{
|
{
|
||||||
static char getpassbuf [PASS_MAX + 1];
|
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);
|
return std::string(getpassbuf);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -84,7 +88,9 @@ static int getch()
|
|||||||
return ch;
|
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 BACKSPACE=127;
|
||||||
const char RETURN=10;
|
const char RETURN=10;
|
||||||
@ -118,6 +124,6 @@ std::string rs_getpass(const char *prompt, bool no_echo)
|
|||||||
|
|
||||||
return std::string(password);
|
return std::string(password);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
* *
|
* *
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
namespace RsUtil {
|
namespace RsUtil {
|
||||||
|
|
||||||
std::string rs_getpass(const std::string& prompt,bool no_echo=true) ;
|
std::string rs_getpass(const std::string& prompt,bool no_echo=true) ;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user