Merge pull request #200 from ClaudiuHKS/master

Set length to 0 on failed lookup in lookupString()
This commit is contained in:
Vincent Herbet 2015-02-08 11:01:43 +01:00
commit 553663c952
4 changed files with 8 additions and 5 deletions

View File

@ -15,7 +15,7 @@ PUBLIC_ROOT = ../../public
PROJECT = geoip
OBJECTS = amxxmodule.cpp GeoIP2/maxminddb.cpp geoip_main.cpp geoip_natives.cpp geoip_util.cpp
OBJECTS = amxxmodule.cpp GeoIP2/maxminddb.c geoip_main.cpp geoip_natives.cpp geoip_util.cpp
##############################################
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###

View File

@ -166,6 +166,9 @@ const char *lookupString(const char *ip, const char **path, int *length)
if (!lookupByIp(ip, path, &result))
{
if (length)
*length = 0;
return NULL;
}

View File

@ -98,7 +98,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\GeoIP2\maxminddb.cpp" />
<ClCompile Include="..\GeoIP2\maxminddb.c" />
<ClCompile Include="..\geoip_main.cpp" />
<ClCompile Include="..\geoip_natives.cpp" />
<ClCompile Include="..\geoip_util.cpp" />
@ -120,4 +120,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -23,7 +23,7 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\GeoIP2\maxminddb.cpp">
<ClCompile Include="..\GeoIP2\maxminddb.c">
<Filter>GeoIP2</Filter>
</ClCompile>
<ClCompile Include="..\geoip_util.cpp">
@ -70,4 +70,4 @@
<Filter>Pawn Includes</Filter>
</None>
</ItemGroup>
</Project>
</Project>