Closed jackrendor closed 5 years ago
Thank you for your PR!
secure_getenv()
is not working on macOS, is there an alternative which also works on Darwin ?
According to the manual
secure_getenv() is a GNU extension.
so it isn't a standard function
What do you think is it really essential to use secure_getenv().
I'm sorry to hear that. And I hope you can apologize me for being late.
I'll make it execute secure_getenv
instead of getenv
only when compiling on Linux. Is it ok for you?
I'll wait for your instructions before pushing.
Can you show me a prototype of this ? If yes I'm fine with it.
Sure. I'll be happy to show it and explain it too.
#ifdef
to identify platfrom (See How to identify platform/compiler from preprocessor macros? )#define
to replace getenv
with secure_getenv
whenever compiling on Linux. From the GCC GNU Docs:
A macro is a fragment of code which has been given a name. Whenever the name is used, it is replaced by the contents of the macro.
getenv
function.Sorry that it took me so long to answer. Thank you for your contribution to sysget. I will merge!
Do not worry about the delay! I'm happy you appreciated the edit! ^^ Happy Coding!
Tested and compiled on
Fedora release 28 (Twenty Eight)
.In this pull request I changed few things:
Replaced
getenv
withsecure_getenv
. From the Linux Programmer's Manual:.vscode
to the.gitignore
to help who uses Visual Studio Code.