| View previous topic :: View next topic |
| Author |
Message |
kaneza
Joined: 09 May 2008 Posts: 31
|
Posted: Fri Apr 10, 2009 4:45 pm Post subject: |
|
|
| i tried it and i am still getting errors while compiling... |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Fri Apr 10, 2009 4:53 pm Post subject: |
|
|
and? you replaced the symbol with a string literal string so the compiler will not be complaining about it unless you are not doing the change or giving correct reports. The change I suggested is fairly minor.
karl. |
|
| Back to top |
|
 |
kaneza
Joined: 09 May 2008 Posts: 31
|
Posted: Fri Apr 10, 2009 4:57 pm Post subject: |
|
|
Here is my code now
| Code: |
const char *ip;
ip = client->con->ip;
if (strcmp (ip, "127.0.0.1") !== 0)
{
const char *ipaddrk = httpp_getvar (client->parser,"X_FORWARDED_FOR");
if (ipaddrk)
ip = ipaddrk;
}
ipaddr = util_url_escape (ip);
|
when i compile i get error ipaddrk not defined and i add it, so the code becomes
| Code: |
const char *ip;
const char *ipaddrk;
ip = client->con->ip;
if (strcmp (ip, "127.0.0.1") !== 0)
{
const char *ipaddrk = httpp_getvar (client->parser,"X_FORWARDED_FOR");
if (ipaddrk)
ip = ipaddrk;
}
ipaddr = util_url_escape (ip);
|
still i get errors while compiling |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Fri Apr 10, 2009 5:03 pm Post subject: |
|
|
you'll have to be more forthcoming if you want other people to fix the problem. ipaddrk is within the if and defined as a const char *, it is not referenced outside of the if. Check your C reference material. I'm not sure why you are changing the if expression either.
karl. |
|
| Back to top |
|
 |
kaneza
Joined: 09 May 2008 Posts: 31
|
Posted: Fri Apr 10, 2009 5:06 pm Post subject: |
|
|
| i changed it because it seemed not to work and i was tryin to work around it. |
|
| Back to top |
|
 |
|