I'm having trouble with the code below with the error on line 5:
error: invalid conversion from void*
to char*
I'm using g++ with codeblocks and I tried to compile this file as a cpp file. Does it matter?
#include <openssl/crypto.h>
int main()
{
char *foo = malloc(1);
if (!foo) {
printf("malloc()");
exit(1);
}
OPENSSL_cleanse(foo, 1);
printf("cleaned one byte
");
OPENSSL_cleanse(foo, 0);
printf("cleaned zero bytes
");
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…