Could anyone here give me an example on how to use the function crypt_r()?
From man page, it is unclear that the returned char * string is pointing to a block of memory allocated (in the heap) inside the function itself, or is still pointing to a static memory, like crypt()?
From the GNU manual:
Kernel.org gives more details:
Both
cryptandcrypt_rreturn a pointer to the encrypted password. Naturally, if you usecrypt_rthat memory will be somewhere in thecrypt_datayou passed.EDIT Example, as requested: