[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 438
  • Last Modified:

warning: passing arg 1 of `my_encryptIDEA` from incompatible pointer type

Hi,

I class myself as a noob (I guess you will agree when you see me code :) So please be gentle....

I have the following code that once I read my config file in, I want to encrypt the password etc. I am using sfl code from http://legacy.imatix.com/html/sfl/sfl.htm
When I compile, using gcc on solaris, I get the following warning: passing arg 1 of `my_encryptIDEA` from incompatible pointer type. Please could someone explain why and how to correct? Thank you.


const char *
my_encryptIDEA(char *buffer[])
{
	char
		key [] = "100110110111011010110";
	int
		len;
 
	len = strlen(buffer);
 
	if (crypt_encode ((byte *)buffer, (long) len,
                           CRYPT_IDEA, (byte *)key))
	{
		return base64_encode(buffer);
	}
  else
	{
		return NULL;
	}
}
 
How it is used:
configInfo->encryptedKey = strdup(my_encryptIDEA(Parameter));

Open in new window

0
smurff
Asked:
smurff
1 Solution
 
Kent OlsenData Warehouse Architect / DBACommented:
Hi smruff,

The message is a warning that says that the function is expecting a pointer to a particular kind of object (in this case a pointer to a character array) and you're actually passing a pointer to something else (I suspect a pointer to a string).

It looks like the function doesn't really need a pointer to an array, just an array.  Try changing the header to:

  my_encryptIDEA (char *buffer)


Good Luck,
Kent
0
 
smurffAuthor Commented:
Wow, went to lunch, came back and the answer was there. Thank you so much.
Kind regards
0

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now