0011-fix-implicit-declaration-of-function-getch.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. From 84c44fbe243dabc91d4fa25f2ba878dcaca9856e Mon Sep 17 00:00:00 2001
  2. From: Davide Beatrici <davidebeatrici@gmail.com>
  3. Date: Fri, 10 Aug 2018 21:22:36 +0200
  4. Subject: [PATCH] Console.c: fix "implicit declaration of function 'getch'"
  5. warning
  6. /builds/SoftEther/SoftEtherVPN/src/Cedar/Console.c: In function 'PasswordPrompt':
  7. /builds/SoftEther/SoftEtherVPN/src/Cedar/Console.c:2051:8: warning: implicit declaration of function 'getch'; did you mean 'getc'? [-Wimplicit-function-declaration]
  8. c = getch();
  9. ^~~~~
  10. getc
  11. Upstream: https://github.com/SoftEtherVPN/SoftEtherVPN/commit/84c44fbe243dabc91d4fa25f2ba878dcaca9856e
  12. Signed-off-by: Thomas Perale <thomas.perale@mind.be>
  13. ---
  14. src/Cedar/Console.c | 4 ++++
  15. 1 file changed, 4 insertions(+)
  16. diff --git a/src/Cedar/Console.c b/src/Cedar/Console.c
  17. index ec861a4ed..2c384facf 100644
  18. --- a/src/Cedar/Console.c
  19. +++ b/src/Cedar/Console.c
  20. @@ -2048,7 +2048,11 @@ bool PasswordPrompt(char *password, UINT size)
  21. else if (c == 0xE0)
  22. {
  23. // Read one more character
  24. +#ifdef OS_WIN32
  25. c = getch();
  26. +#else // OS_WIN32
  27. + c = getc(stdin);
  28. +#endif // OS_WIN32
  29. if (c == 0x4B || c == 0x53)
  30. {
  31. // Backspace