Hi,
This code works fine on win and linux but not on hpux. All is compiled
with gcc. Can anyone help please?
/*************** *************** *************** *************** *************** **/
/*
*/
/* encrypt
*/
/*
*/
/*************** *************** *************** *************** *************** **/
/* Description: Utility function that simply encrypts a string. Used
for */
/* simple password storage in the config file.
*/
/*
*/
/*************** *************** *************** *************** *************** **/
void encrypt(char str[],int key)
{
unsigned int i;
for(i=0;i<strle n(str);++i)
{
str[i] = str[i] - key;
}
}
/*************** *************** *************** *************** *************** **/
/*
*/
/* decrypt
*/
/*
*/
/*************** *************** *************** *************** *************** **/
/* Description: Utility function that simply decrypts a string. Used
for */
/* simple password storage in the config file.
*/
/*
*/
/*************** *************** *************** *************** *************** **/
void decrypt(char str[],int key)
{
unsigned int i;
for(i=0;i<strle n(str);++i)
{
str[i] = str[i] + key;
}
}
The decrypt function even shortens the length, which as you can see,
shouldnt happen and doesnt on other OSs
Any help would be great, thanks
Kind regards
Danny